How to use the getOperationAST function from graphql

Find comprehensive JavaScript graphql.getOperationAST code examples handpicked from public code repositorys.

125
126
127
128
129
130
131
132
133
134
customParseFn,
customValidateFn,
customExecuteFn: async (args) => {
  const { document, operationName, variableValues } = args

  const operationAST = getOperationAST(document, operationName)
  if (!operationAST) {
    return {
      errors: [
        new GraphQLError(
fork icon33
star icon66
watch icon0

298
299
300
301
302
303
304
305
306
307
    ctx.operationName = processed.request.operationName;
    ctx.request.operationName = processed.request.operationName;
    ctx.request.variables = processed.request.variables;

    ctx.document = parse(processed.request.query);
    ctx.operation = getOperationAST(ctx.document, ctx.operationName);
  }
},

// responseForOperation executed right before request is propagated to the server
fork icon0
star icon9
watch icon4

+ 18 other calls in file