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

chore(docs): add Readme section for GET requests #370

Merged
merged 1 commit into from Jul 28, 2022

Conversation

jschuur
Copy link
Contributor

@jschuur jschuur commented Jul 26, 2022

This adds a sample implementation of @toinelin's #277, since the ability to make GET requests was otherwise not documented.

Note that you have to specifically pass in a jsonSerializer, or it'll break trying to stringify the query parameters:

const graphQLClient = new GraphQLClient(endpoint, {
  method: 'GET',
  jsonSerializer: {
    parse: JSON.parse,
    stringify: JSON.stringify,
  },
});

This took me a while to figure out, so I thought this would make for a good addition to the docs. Should probably default to defaultJsonSerializer though.

Copy link
Owner

@jasonkuhrt jasonkuhrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty!

@jasonkuhrt jasonkuhrt changed the title docs: add Readme section for GET requests chore(docs): add Readme section for GET requests Jul 28, 2022
@jasonkuhrt jasonkuhrt merged commit fec536b into jasonkuhrt:master Jul 28, 2022
@jschuur jschuur deleted the docs/get-requests branch July 28, 2022 19:23
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.

None yet

2 participants