graphql-elixir / plug_graphql

Plug (Phoenix) integration for GraphQL Elixir
Other
126 stars 7 forks source link

Allow root_value to be passed along to GraphQL.execute #9

Closed aweiker closed 8 years ago

aweiker commented 8 years ago

During plug initialization, allows a function to be defined that will take a conn as input and then return a data structure that can be used as the root_value into the GraphQL.execute method.

joshprice commented 8 years ago

Thanks for the PR! See comments, but otherwise looks great.

aweiker commented 8 years ago

I'm adding the comments and have most of them addressed. Do you prefer getting it rebased into a single commit, or do you want to see a new commit?

joshprice commented 8 years ago

Not too fussed about squashing commits, but this will need to be rebased on top of the new changes. Sorry I couldn't get this merged in before I refactored things. Ping me on Slack if you need a hand or have any questions.

The other thing that is missing is variables, which is pretty much the same as root_value so if you feel like adding that, cool, otherwise it's easy to add once this is merged.

joshprice commented 8 years ago

Awesome thanks again!