Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

The schema for Realm at path is empty #52

Open
scolobey opened this issue May 10, 2020 · 2 comments
Open

The schema for Realm at path is empty #52

scolobey opened this issue May 10, 2020 · 2 comments

Comments

@scolobey
Copy link

scolobey commented May 10, 2020

Is it possible to set schema from the client?

Running a basic mutation such as:

const client = config.createApolloClient();

    const response = await client.mutate({
      mutation: gql`
        mutation CreateReview($review: ReviewInput!) {
          createReview(input: $review) {
            commentary
            stars
          }
        }
      `,
      variables: {
        "review": {
          "stars": 5,
          "commentary": "This is a great movie!"
        }
      }
    });

Results in this error:
{"graphQLErrors":[],"networkError":{"name":"ServerParseError","response":{},"statusCode":500,"bodyText":"Invalid options provided to ApolloServer: The schema for Realm at path /5eb82c6cf6e0750f9ebf556b/recipes is empty."},"message":"Network error: Unexpected token I in JSON at position 0"}

Unless I manually enter the schema.

Do I need to create all Realms and set schema via the server before interacting with them via client?

@nirinchev
Copy link
Member

Yes, manipulating the schema from the GraphQL client is not something that we support.

@scolobey
Copy link
Author

Got it, thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants