Open lacklock opened 4 years ago
Please post all requests you're making as well as the responses you're getting (feel free to obscure the credentials).
You're sending the request to the wrong endpoint. The route after /graphql
is interpreted as the Realm path, so you're trying to query a Realm called /schema/default
with a token that grants you access to /default
. If you're trying to get the schema of your Realm, the correct way to do it is via the regular GraphQL query API. You can issue a GraphQL request like:
query {
__schema {
types {
name
fields {
name
}
}
}
}
That still needs to be sent to /graphql/default
like all other queries/mutations affecting that Realm.
Using query schema on other realm instance is working. But query on /default realm is always reponse 503.
"{\"type\":\"https://docs.realm.io/server/troubleshoot/errors#service-unavailable\",
\"title\":\"The requested service is temporarily unavailable.\",
\"status\":503,\"code\":802}"
Why doc says schema endpoint path is /graphql/schema/:path
, I thought it means post to endpoint could get schema.
The docs seem to be outdated.
Goals
using correct ACCESS_TOKEN.TOKEN to query data
Expected Results
Success
Actual Results
Access token request
Schema request
https://mobile-log.us1a.cloud.realm.io/graphql/schema/default
Response
Steps to Reproduce
I want to using graphQL execute query. I have a admin account user. I want to query from the default realm, path is /default .
Post body is: { "app_id":"", "provider":"realm", "data":"REFRESH_TOKEN.TOKEN", "path":"/default" }
But when using the response token put in the Authorization header send request, it will response 401:
{"type":"https://docs.realm.io/server/troubleshoot/errors#invalid-credentials","title":"The provided credentials are invalid or the user does not exist.","status":401,"detail":"The access token doesn't grant access to the requested path.","code":611}