-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: TypedDocumentNode support & strict variable typings (#350)
Co-authored-by: Charly POLY <cpoly55@gmail.com> Co-authored-by: Jason Kuhrt <jasonkuhrt@me.com>
- Loading branch information
1 parent
fec536b
commit a7ac904
Showing
21 changed files
with
648 additions
and
457 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Security Policy | ||
|
||
If you have a security issue to report, please contact us at [security@prisma.io](mailto:security@prisma.io). | ||
If you have a security issue to report, please contact us at [security@prisma.io](mailto:security@prisma.io). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { TypedDocumentNode } from '@graphql-typed-document-node/core' | ||
import { parse } from 'graphql' | ||
|
||
import { request } from '../src' | ||
;(async function () { | ||
const endpoint = 'https://graphql-yoga.com/api/graphql' | ||
|
||
const query: TypedDocumentNode<{ greetings: string }, never | Record<any, never>> = parse(/* GraphQL */ ` | ||
query greetings { | ||
greetings | ||
} | ||
`) | ||
|
||
const variables = {} | ||
|
||
const data = await request(endpoint, query, variables) | ||
|
||
console.log(data.greetings) | ||
})().catch(console.error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { JsonSerializer } from "./types.dom"; | ||
import { JsonSerializer } from './types.dom' | ||
|
||
export const defaultJsonSerializer: JsonSerializer = { | ||
parse: JSON.parse, | ||
stringify: JSON.stringify | ||
} | ||
stringify: JSON.stringify, | ||
} |
Oops, something went wrong.