Initialisation
Added the packages and files for the backend server
This commit is contained in:
12
node_modules/@graphql-tools/utils/esm/getOperationASTFromRequest.js
generated
vendored
Normal file
12
node_modules/@graphql-tools/utils/esm/getOperationASTFromRequest.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { getOperationAST } from 'graphql';
|
||||
import { memoize1 } from './memoize.js';
|
||||
export function getOperationASTFromDocument(documentNode, operationName) {
|
||||
const doc = getOperationAST(documentNode, operationName);
|
||||
if (!doc) {
|
||||
throw new Error(`Cannot infer operation ${operationName || ''}`);
|
||||
}
|
||||
return doc;
|
||||
}
|
||||
export const getOperationASTFromRequest = memoize1(function getOperationASTFromRequest(request) {
|
||||
return getOperationASTFromDocument(request.document, request.operationName);
|
||||
});
|
||||
Reference in New Issue
Block a user