feat: replace GraphQL Apollo with GraphQL Yoga (#7967)

This commit is contained in:
Antoine Cormouls
2022-05-18 19:55:43 +02:00
committed by GitHub
parent b2ae2e1db4
commit 1aa2204aeb
9 changed files with 488 additions and 1143 deletions

View File

@@ -1,5 +1,5 @@
import Parse from 'parse/node';
import { ApolloError } from 'apollo-server-core';
import { GraphQLYogaError } from '@graphql-yoga/node';
export function enforceMasterKeyAccess(auth) {
if (!auth.isMaster) {
@@ -16,7 +16,7 @@ export function toGraphQLError(error) {
code = Parse.Error.INTERNAL_SERVER_ERROR;
message = 'Internal server error';
}
return new ApolloError(message, code);
return new GraphQLYogaError(message, { code });
}
export const extractKeysAndInclude = selectedFields => {