graphql-config icon indicating copy to clipboard operation
graphql-config copied to clipboard

Local schema as npm dependency

Open wintermute42 opened this issue 4 years ago • 1 comments

Hi guys, I have dependency in my project which contains the schema file. It seems I can't get the config right, or at least my IDE (webstorm) seems to be ignorant of the schema file. Some help would be appreciated. Thanks!

{
  "schemaPath": "./node_modules/@foo/graphql-schema/schema/schema.graphqls",
  "extensions": {
    "endpoints": {
      "local": {
        "url": "http://localhost:8000/graphql"
      }
    }
  }
}

wintermute42 avatar Sep 25 '19 07:09 wintermute42

We could add @graphql-tools/module-loader to support loading schemas using module:someModule#identifier syntax. The existing loaders should however already be able to pick up a file like this:

schema: './node_modules/@foo/graphql-schema/schema/schema.graphql'

danielrearden avatar Jul 19 '20 02:07 danielrearden