Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get schema from url #270

Open
AdrienLemaire opened this issue May 27, 2020 · 1 comment
Open

Get schema from url #270

AdrienLemaire opened this issue May 27, 2020 · 1 comment

Comments

@AdrienLemaire
Copy link

This is a follow-up on #4, although I'd also be pleased if #257 gets implemented.

I'm using an augmented schema, which can be found via a url.

I thought eslint-plugin-graphql supported graphql-config, and following their doc, I tried

# .graphqlrc
schema: 'http://localhost:4001/graphql'

I now understand that eslint-plugin-graphql only supports a .graphqlconfig file containing a schemaPath key, which is rather limiting.

Is it correct that we cannot currently use an url endpoint, and must keep updated a downloaded json file?

@FreekVR
Copy link

FreekVR commented Sep 28, 2020

I'm currently using an updates version of graphql v15 and graphql-cli v4 which indeed has me running into the same issue, I'm running an introspection query to fetch the schema with the following config as per the graphql config docs:

schema: ${API_ENDPOINT:https://cms.digitalnatives.nl/graphql}
documents: 'graphql/**/*.graphql'
extensions:
  codegen:
    generates:
      ./schema.json:
        plugins:
          - introspection

Using with this plugin leads to the following error:

Error: Error while loading rule 'graphql/template-strings': Loader Url has no sync mode.

It would be great if the eslint plugin would support these extended/changed schema options.

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

No branches or pull requests

2 participants