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

Include directive definition in graphql-config to enable in vscode language server #174

Open
dcorwin-seagen opened this issue May 9, 2023 · 0 comments

Comments

@dcorwin-seagen
Copy link

Hi there, thanks for all the hard work! Just wondering if anyone knows the best way to include the directive in graphql-config so GraphQL LS can pick it up. Without including it explicitly the language server fails, preventing "jump to definition" and other features from working at all.

I did get it to work by copying and pasting the constraint definition from type-defs.js into a separate .graphql file then including that in the list of schemas in the configuration:

// .graphqlrc.json
{
  "schema": [
    "api/schema.graphql",
    "api/foo.graphql"
  ]
}

but this doesn't seem like the best approach. I've tried just including type-defs.js from node-modules but that didn't work, possibly because it's just a string not a gql template? The docs on graphql-config and the LS aren't that thorough either so not sure if there is something I am missing there.

Thanks!!

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

1 participant