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

disable schema dump #64

Open
leoGalani opened this issue Aug 14, 2019 · 3 comments
Open

disable schema dump #64

leoGalani opened this issue Aug 14, 2019 · 3 comments

Comments

@leoGalani
Copy link

Hi, is there a way to avoid automatic schema dump/introspection query?

Graphql for ruby (v1.9.7 ++) have the ability to disable those for production and I couldn't find a way of disabling the automatic fetch locally.

This is the message I'm getting and trying to client.schema or any operation (which in the end hits https://github.com/rmosolgo/graphql-ruby/blob/master/lib/graphql/schema/loader.rb#L16 )

(byebug) client.schema
*** KeyError Exception: key not found: "data"

Any thoughts besides mocking the schema?

@yuki24
Copy link
Collaborator

yuki24 commented Aug 14, 2019

Disabling them in production makes sense to me, but I do not think there is an easy way to do so at this point.

@ashkan18 Perhaps something we could accept with a PR?

@yuki24
Copy link
Collaborator

yuki24 commented Aug 14, 2019

Just quickly skimming the commit logs in graphql-client, but it doesn't seem to have support for it yet.

graphlient depends on graphql-client which depends on graphql-ruby, so it needs to be implemented in graphql-client first.

@ashkan18
Copy link
Owner

thanks @leoGalani for opening the issue, yes i think at the moment the easiest approach would be either mocking the schema, or (maybe better?) use a local dump of your target schema locally and pass it to the client:

Client.new(url, schema_path: 'config/your_graphql_schema.json')

would this help you out?

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

3 participants