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

How to send query variables #74

Open
fabiodr opened this issue Mar 12, 2017 · 3 comments
Open

How to send query variables #74

fabiodr opened this issue Mar 12, 2017 · 3 comments

Comments

@fabiodr
Copy link

fabiodr commented Mar 12, 2017

Is there a way to send the variable $episode in following example?

query HeroNameAndFriends($episode: Episode) {
  hero(episode: $episode) {
    name
    friends {
      name
    }
  }
}

{
  "episode": "JEDI"
}

http://graphql.org/learn/queries/#variables

Thanks!

@chkimes
Copy link
Owner

chkimes commented Mar 14, 2017

Hey @fabiodr,

This is what #23 is about. The IExecContext is simply an implementation that provides a Value (https://github.com/ckimes89/graphql-net/blob/master/GraphQL.Parser/Parsing/ParserAST.fs#L62) from a string. The user can specify their own implementation of IExecContext, but it makes a lot of sense for us to provide ones that handle this from common formats (e.g. JSON). This is not a very difficult thing to implement, but unfortunately due to my time constraints as of late I have not been able to do so. I may be able to work on this sometime during next week, though.

@fabiodr
Copy link
Author

fabiodr commented Mar 14, 2017

Great! I tried to dig a little into the code and found these indications of an IExecContext implementation needed, i'll try to better understand F# to see if i can be helpfull in these, anyway, it seems a nice language.

Are you using Apollo Client too? Just found a nice chrome extension from them for client store inspection:
https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm

@chkimes
Copy link
Owner

chkimes commented Mar 14, 2017

If you're looking to learn F#, this eBook is pretty good: https://swlaschin.gitbooks.io/fsharpforfunandprofit/content/ It's a collection of all the content from the F# For Fun and Profit blog.

I have used Apollo Client before for a few things and I used their inspector extension as well. I was pretty amazed when I first used it - it's a very high quality tool.

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