Skip to content

Added new Go client to the list #431

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

Merged
merged 2 commits into from
Jun 29, 2018
Merged

Added new Go client to the list #431

merged 2 commits into from
Jun 29, 2018

Conversation

matryer
Copy link
Contributor

@matryer matryer commented Dec 9, 2017

This client solves the common problems of making queries, setting variables, and uploading files, while leaving the rest to the user. It's deliberately very simple, which means it will soften the learning curve for somebody trying GraphQL for the first time.

Code example:

// create a client (safe to share across requests)
client := graphql.NewClient("https://machinebox.io/graphql")

// make a request
req := graphql.NewRequest(`
    query ($key: String!) {
        items (id:$key) {
            field1
            field2
            field3
        }
    }
`)

// set any variables
req.Var("key", "value")

// run it and capture the response
var respData ResponseStruct
if err := client.Run(ctx, req, &respData); err != nil {
    log.Fatal(err)
}

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@leebyron leebyron merged commit e79f699 into graphql:source Jun 29, 2018
Dipeshwagle pushed a commit to Dipeshwagle/graphql.github.io that referenced this pull request Aug 18, 2020
Dipeshwagle pushed a commit to Dipeshwagle/graphql.github.io that referenced this pull request Aug 18, 2020
This Go GraphQL client was added in PR graphql#431 to the section for
Go GraphQL server libraries. Move it to the section for Go GraphQL
client libraries instead.
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

Successfully merging this pull request may close these issues.

3 participants