julienvincent / modelizr

Generate GraphQL queries from models that can be mocked and normalized.
http://julienvincent.github.io/modelizr
176 stars 6 forks source link

Generalise Queries #3

Closed alexisvincent closed 8 years ago

alexisvincent commented 8 years ago

I noticed that the current implementation assumes root level queries query and mutation (I think?). Please note that while this probably how most people are using graphql, modeller shouldn't make any assumptions about user top level queries.

A top level query can have the following example forms (Again, I'm pretty sure this is how it works):

query Alias {}
someThing Thingie {}
mutation lol {}

Users should be able to specify the top level exposed name and the specific query alias. Also, mutations are functionally equivalent to queries. The only difference is convention.

julienvincent commented 8 years ago

I'm pretty sure GraphQL's spec defines mutations as mutation someName. You are able to modify someName using a .as() modifier.

julienvincent commented 8 years ago

Need to check up on the spec though.

alexisvincent commented 8 years ago

You're right, checkout 2.3