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

Have a better way of getting the schema, for example a URL #4

Closed
stubailo opened this issue Apr 23, 2016 · 11 comments
Closed

Have a better way of getting the schema, for example a URL #4

stubailo opened this issue Apr 23, 2016 · 11 comments
Labels
feature New addition or enhancement to existing solutions

Comments

@stubailo
Copy link
Contributor

It would be a hassle to run a build script every time the schema changes, I'm sure there is a simpler way.

Blocks: https://github.com/apollostack/meteor-starter-kit/pull/5

@stubailo
Copy link
Contributor Author

@schickling
Copy link

First of all: Thanks for this great plugin!

This is a great idea and exactly what we tried to facilitate with babel-plugin-react-relay when developing apps with Relay. We've implemented this feature using sync-request due to the limitation of Babel that you just can run synchronous plugins.

I'd be very interested to learn more about the implementation details of the upcoming feature. Maybe we can improve the babel-plugin as well.

@stubailo
Copy link
Contributor Author

One thing I'm really interested in is standardizing some config about how to reach your server. Maybe something like this:

ardatan/graphql-tools#40 (comment)

That way, our different plugins might be able to share information about the server, instead of all being configured separately. What do you think? What info would you need in there for your plugin?

@schickling
Copy link

That sounds like a very good idea. The problem with Babel is that it's very limited concerning the way how you pass plugin configuration, therefore we had to provide the config in the package.json.
Maybe we come up with some kind of .graphqlrc file?

This is also something worth considering: facebook/relay#1080

@stubailo
Copy link
Contributor Author

Yeah having support for multiple schemas is something I thought about as well. I wonder how you would specify which queries are against which schema for the linter...

Maybe we come up with some kind of .graphqlrc file?

That's kind of what I meant, yeah - something that sits at the root of your project and all build tools can draw from. Maybe we can start listing requirements here? https://github.com/apollostack/graphqlrc

@stubailo
Copy link
Contributor Author

@schickling hey, I added you to https://github.com/apollostack/graphqlrc, so if you have time to lay down some ideas feel free to just commit to the README!

@stubailo stubailo added feature New addition or enhancement to existing solutions and removed enhancement labels Apr 27, 2016
@thebigredgeek
Copy link

Any progress on this?

@schickling
Copy link

schickling commented Oct 27, 2016

Not yet. @stubailo and I have to find a time to finish this once and for all 💪

@jamiter
Copy link

jamiter commented Mar 31, 2017

Would you consider pointing to a .graphql file directly, instead of a .json file coming from a server or the file system? Maybe this linter could parse that file and use it. Or maybe multiple .graphql files. This way I wouldn't need a server to check my linting rules.

Edit: I say this because the webpack loader and the Meteor build plugin both handle .graphql files directly, so it would be great to point to those files, instead of first having to parse or serve them.

BTW, awesome plugin 😄

Edit2: Looks like it would only require a simple change here: https://github.com/apollographql/eslint-plugin-graphql/blob/master/src/index.js#L153-L154, adding a .graphql file and parsing it. Would a PR for it be considered?

Edit3: We could use this code for it: https://github.com/nodkz/webpack-plugin-graphql-schema-hot/blob/master/index.js#L113-L124

@schickling
Copy link

@jamiter the best place to contribute to this discussion is here: kamilkisiela/graphql-config#20

This will soon be released and hopefully also finds its way back to the eslint plugin 🙂

@schickling
Copy link

This will be solved by #80 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New addition or enhancement to existing solutions
Projects
None yet
Development

No branches or pull requests

4 participants