graphql / graphql-playground

🎮 GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration)
MIT License
8.77k stars 735 forks source link

Load schema from file #1303

Open baflo opened 3 years ago

baflo commented 3 years ago

This issue pertains to the following package(s):

What OS and OS version are you experiencing the issue(s) on?

Windows 10 20H2

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

1.8.10

What is the expected behavior?

Schema should be loaded from file if given by .graphqlconfig

What is the actual behavior?

Schema is not loaded

What steps may we take to reproduce the behavior?

Save this file as .graphqlconfig:

{
  "schema": "schema.gql",
  "documents": "apps/backend/src/app/common/**/*.graphql",
  "projects": {
    "app": {
      "schemaPath": "schema.gql",
      "extensions": {
        "endpoints": {
          "default": "http://localhost:4000/graphql"
        }
      }
    }
  }
}

and this as graphql.yml:

type Query {
  getSetting: Setting!
}

type Setting {
  id: Int!
  highlightColor: String!
  errorColor: String!
  infoColor: String!
  logoUrl: String!
}

Then open the workspace containing the .graphlconfig. It won't load the schema.

Please provide a gif or image of the issue for a quicker response/fix.

acao commented 3 years ago

i will take a look at this once we’re able to successfully build the electron app again!

moon-sam commented 2 years ago

Any chance this was fixed?