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(api-graphql): Bump graphql to 14.5.0 #8984
Changes from 5 commits
c700189
ec78195
c28d26f
fc36ee2
da167b2
a36896d
a60c434
b5beb30
f8e79e4
924a08e
5083e0d
f565165
58bc6c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -12,7 +12,7 @@ | |||||||||
*/ | ||||||||||
import { GraphQLError } from 'graphql/error/GraphQLError'; | ||||||||||
// @ts-ignore | ||||||||||
import { OperationDefinitionNode } from 'graphql/language'; | ||||||||||
import { DocumentNode, OperationDefinitionNode } from 'graphql/language'; | ||||||||||
wlee221 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
import { print } from 'graphql/language/printer'; | ||||||||||
import { parse } from 'graphql/language/parser'; | ||||||||||
import Observable from 'zen-observable-ts'; | ||||||||||
|
@@ -203,9 +203,10 @@ export class GraphQLAPIClass { | |||||||||
*/ | ||||||||||
getGraphqlOperationType(operation) { | ||||||||||
const doc = parse(operation); | ||||||||||
const { | ||||||||||
definitions: [{ operation: operationType }], | ||||||||||
} = doc; | ||||||||||
const definitions = doc.definitions as ReadonlyArray< | ||||||||||
OperationDefinitionNode | ||||||||||
>; | ||||||||||
const [{ operation: operationType }] = definitions; | ||||||||||
Comment on lines
-206
to
+211
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not so confident with this one. It seems that
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update: I found that |
||||||||||
|
||||||||||
return operationType; | ||||||||||
} | ||||||||||
|
@@ -294,7 +295,7 @@ export class GraphQLAPIClass { | |||||||||
}; | ||||||||||
|
||||||||||
const body = { | ||||||||||
query: print(query), | ||||||||||
query: print(query as DocumentNode), | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to address I'm confident that this query is always of type amplify-js/packages/api-graphql/src/GraphQLAPI.ts Lines 225 to 228 in ec78195
in which parse returns There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Either we can do const ParsedGraphQLOption = Omit<GraphQLOptions, 'query'> & {query: DocumentNode} but I kept it simple for now. Opinions welcome! |
||||||||||
variables, | ||||||||||
}; | ||||||||||
|
||||||||||
|
@@ -389,7 +390,7 @@ export class GraphQLAPIClass { | |||||||||
appSyncGraphqlEndpoint, | ||||||||||
authenticationType, | ||||||||||
apiKey, | ||||||||||
query: print(query), | ||||||||||
query: print(query as DocumentNode), | ||||||||||
region, | ||||||||||
variables, | ||||||||||
graphql_headers, | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not using
graphql@15.6.0
?