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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for get request #277

Merged
merged 1 commit into from Jul 21, 2021

Conversation

antoinelin
Copy link
Contributor

@antoinelin antoinelin commented Jul 19, 2021

馃枛馃徎 Hello Prisma team,

Here is a proposal to provide support for GET requests.
Should resolve #61 and #260

@@ -1,7 +1,7 @@
import crossFetch, * as CrossFetch from 'cross-fetch'
import { print } from 'graphql/language/printer'
import createRequestBody from './createRequestBody'
import { ClientError, GraphQLError, RequestDocument, Variables } from './types'
import { ClientError, RequestDocument, Variables } from './types'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed GraphQLError as it is not in use

* Fetch data using POST method
*/
const post = async <V = Variables>(
url: string,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I followed the way you declare functions to keep consistency but I'm not a huge fan of using too much args here and I spend much time to think if I should use a typed object here. Tell me if it is okay for you or if you want me to change this

@antoinelin
Copy link
Contributor Author

Before back and forth/review is done and the PR merged/closed, I published a working version of my fork on NPM you may find here : https://www.npmjs.com/package/@vahill/graphql-request

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.

LGTM

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.

Support for "GET" requests
2 participants