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

Defining queries using structured data #32

Closed
wclr opened this issue Jun 15, 2016 · 2 comments
Closed

Defining queries using structured data #32

wclr opened this issue Jun 15, 2016 · 2 comments

Comments

@wclr
Copy link

wclr commented Jun 15, 2016

I'm just exploring graphql and see existing way of doing requests from client is using string based queries. I see such approach as kinda error prone and unstructured. What are the advantages of this? Do you see any advantages (or maybe obvious disadvantages) if there would be a way in defining queries using json object instead of string?

Kind of:

user: {
  query: {id: 32423},
  fields: [
     'id', `name`, 
     {`profilePicture`: {
        query: {size: '50'}, 
        fields: ['uri', 'weigh', 'height']
     }}
  ]
}

Also I see thy way of defining schema using string based approach is too kind of error prone.

@helfer
Copy link
Contributor

helfer commented Jun 15, 2016

GraphQL queries are well-defined, and given the (strongly typed) schema they can be checked for syntactic and semantic errors, unlike the JSON objects. GraphQL queries are thus less error prone (at least in theory). Check out eslint-plugin-graphql for an example of what's possible with GraphQL. And that's really just the beginning.

@helfer
Copy link
Contributor

helfer commented Jun 29, 2016

Closing since no activity for 2 weeks. Feel free to reopen to continue the discusssion.

@helfer helfer closed this as completed Jun 29, 2016
trevor-scheer pushed a commit that referenced this issue May 6, 2020
Update operation registry plugin to use manifest v2
trevor-scheer pushed a commit that referenced this issue May 12, 2020
Update operation registry plugin to use manifest v2
trevor-scheer pushed a commit that referenced this issue May 14, 2020
Update operation registry plugin to use manifest v2
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants