GraphQL Endpoint HTTP request


#1

Hi everyone,

I’m new to the GraphQl. My question is that I replaced the %2F__admin with my own encoded url path but it said that “Invalid options provided to ApolloServer: Material fields must be an object with field names as keys or a function which returns such an object.”

My normal relative path is: /4448b767c909852f721890dc4956c920/testdb
My encoded one is: %2F4448b767c909852f721890dc4956c920%2Ftestdb

And I called my HTTP request via my server: http://localhost:9060/graphql/%2F4448b767c909852f721890dc4956c920%2Ftestdb

Am I doing something wrong here?

Sorry if I asked the question that has been answered before.

Thanks


#2

I can’t see an immediate problem with what you’re describing. Do you have a schema defined for the Realm you’re opening? If you open it in Studio, do you see any tables?


#3

@nirinchev I’m kind of seeing a similar result.

I haven’t changed my request at all and at different times get different 500 responses back. The current one is Invalid options provided to ApolloServer: Syntax Error: Expected Name, found } I’ve also seen Invalid options provided to ApolloServer: OOObject fields must be an object with field names as keys or a function which returns such an object.

My realm (/userInfo) does contain a class OOOrganization (uuid, name) and my query looks as such:
query { OOOrganization { uuid name } } which Apollo does so magic to and transforms it into { OOOrganization { uuid name __typename } } and the JSON payload that gets sent over is {"operationName":null,"variables":{},"query":"{\n OOOrganization {\n uuid\n name\n __typename\n }\n}\n"}

Thanks