Skip to content

Commit ca544fe

Browse files
committed
remove implicit gql ast converting
1 parent 2c9784c commit ca544fe

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

graphql.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,7 @@
168168

169169
GraphQLClient.prototype.processQuery = function (query, fragments) {
170170
if (typeof query == 'object' && query.hasOwnProperty('kind') && query.hasOwnProperty('definitions')) {
171-
// This looks like a graphql AST.
172-
try {
173-
var graphql = eval('require(\'graphql\')') // webpack tries to include this
174-
query = graphql.print(query)
175-
} catch (e) {
176-
throw new Error("You tried to pass a graphql syntax tree but it cannot be compiled to string.")
177-
}
171+
throw new Error("Do not use graphql AST to send requests. Please generate query as string first using `graphql.print(query)`")
178172
}
179173
var fragmentRegexp = GraphQLClient.FRAGMENT_PATTERN
180174
var collectedFragments = this.collectFragments(query, fragments)

graphql.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)