How to make object classes available in GraphQL

Hi, I want to query object ‘pin’ in Test environment in GraphQL.

pin is enabled for GraphQL.
My user is Superuser, should it should have access to the object.


The test environment is GraphQL enabled

Opening GraphQL for test environment and running

{
	CurrentUser
}

returns data.

While running

{
	pin
}

returns

{
  "errors": [
    {
      "message": "Cannot query field \"pin\" on type \"RootQueryType\".",
      "locations": [
        {
          "line": 33,
          "column": 2
        }
      ]
    }
  ]
}

I can see in the Docs in GraphQL, that pin does not appear as a source:

What am I doing wrong here?

Maybe the changes needs to be deployed in Test. But, if I try the same in Development


GraphQL won’t open properly. The link returns:

{"error":{"name":"MissingTokenError","message":"Unable to find token in request","code":13001,"statusCode":401},"code":13001,"message":"Unable to find token in request"}

Hi!

Seems like you are not redirected to the loginpage if you try to browse the graphql explorer without being logged in to the client. We’re registering a challenge on that one.
image

Try to access an App in the same environment first, and then launch the graphql explorer!

Thank you, Kristian.

Hi, I’m not able to “Reference Objects” in my query in GraphQL.

I Have an object “administrator” where “organization” is a field. I want to get name from organization from administrator. When I run:

{administrator {
  _id
  organization {
    name
  }
  user
  profileImage
  role
  af_createdDate
  af_updatedDate
}}

I get:

{
  "errors": [
    {
      "message": "Field \"organization\" must not have a selection since type \"String\" has no subfields.",
      "locations": [
        {
          "line": 3,
          "column": 16
        }
      ]
    }
  ]
}

Why does it treat organization as a string? I understand that it is represented as a string, but I want to reference the object organization. administrator.organization points to the object organization:

What am I missing?

got it, need to use organization_reference!

Is there a way to query fields on the built in “user” object? I would like to get e.g. administrator.user.firstname