Skip to content

Instantly share code, notes, and snippets.

@juanmaguitar
Last active June 10, 2018 19:50
Show Gist options
  • Select an option

  • Save juanmaguitar/c30917b55ef4ec5b01a4fb4948a73dbc to your computer and use it in GitHub Desktop.

Select an option

Save juanmaguitar/c30917b55ef4ec5b01a4fb4948a73dbc to your computer and use it in GitHub Desktop.
GraphQL NOtes

GraphQL Notes

https://github.com/chentsulin/awesome-graphql

-Let's learn GraphQL

[

Example 1

query getFewPosts($postCount: Int!, $commentCount: Int) {
  recentPosts(count: $postCount) {
    title,
    ...comments
  }
}

fragment comments on Post {
  comments(limit: $commentCount) {
    content
  }
}

QUERY VARIABLES

{
  "postCount": 2,
  "commentCount": 2
}

Result

{
  "data": {
    "recentPosts": [
      {
        "title": "La creme de la creme is cool to work",
        "comments": [
          {
            "content": "This is a very good blog post"
          },
          {
            "content": "Keep up the good work"
          }
        ]
      },
      {
        "title": "New Feature: Tracking Error Status with Kadira",
        "comments": [
          {
            "content": "This is a very good blog post"
          },
          {
            "content": "Keep up the good work"
          }
        ]
      },
      {
        "title": "Understanding Mean, Histogram and Percentiles",
        "comments": [
          {
            "content": "This is a very good blog post"
          },
          {
            "content": "Keep up the good work"
          }
        ]
      }
    ]
  }
}

Example 2

query getFewPosts($category: Category) {
  posts(category: $category) {
    title
  }
}

QUERY VARIABLES

{
  "category": "PRODUCT"
}

Result

{
  "data": {
    "posts": [
      {
        "title": "New Feature: Tracking Error Status with Kadira"
      },
      {
        "title": "Introducing Kadira Debug, Version 2"
      },
      {
        "title": "Awesome Error Tracking Solution for Meteor Apps with Kadira"
      },
      {
        "title": "What Should Kadira Build Next?"
      },
      {
        "title": "Tracking Meteor CPU Usage with Kadira"
      }
    ]
  }
}

Stack Overflow #

Many members of the community use Stack Overflow to ask and answer questions. Read through the existing questions tagged with graphql or ask your own!

Facebook Group #

Join the GraphQL Facebook Group for questions, discussion, and sharing. The GraphQL Facebook group is the preferred venue for announcements and broader discussion.

Twitter #

Use the #graphql hashtag on Twitter to join the conversation.

Here are some helpful accounts to follow: - @GraphQL - @graphqlweekly - @graphqlnews - @GraphQLStackOverflow - @apollostack - @graphcool - @ScapholdDotIO

IRC #

Chat with GraphQL developers on IRC at the https://freenode.net/ server on the #graphql channel.

Slack & Discord #

Many GraphQL developers idle in Discord and Slack chatrooms for live communication and quick questions.

Join #graphql on the ReactiFlux Discord.

Slack Communities: #

Blogs #

Here are a list of notable blog posts to help you better understand GraphQL:

Videos #

Developers inside and outside of Facebook have given talks about GraphQL at conferences and meetups around the world. Here are some of our favorites:

More Resources #

To explore other community-developed resources and content about GraphQL, take a look at these sites:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment