feat: Switch GraphQL server from Yoga v2 to Apollo v4 (#8959)

This commit is contained in:
Onur
2024-03-02 04:06:47 +03:00
committed by GitHub
parent 01c97f7ab7
commit 105ae7c8a5
7 changed files with 1033 additions and 564 deletions

View File

@@ -1,5 +1,5 @@
import Parse from 'parse/node';
import { GraphQLYogaError } from '@graphql-yoga/node';
import { GraphQLError } from 'graphql';
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 GraphQLYogaError(message, { code });
return new GraphQLError(message, { extensions: { code } });
}
export const extractKeysAndInclude = selectedFields => {