Browse Source

fix: Update apollo, regenerate package.json

style/lint-staged
Dale 3 weeks ago
parent
commit
d9b60d2318
Signed by: Deiru GPG Key ID: AA250C0277B927E1
  1. 3
      next-env.d.ts
  2. 4
      package.json
  3. 5
      src/server/graphql/directives/auth.tsx
  4. 6
      src/server/graphql/index.ts
  5. 2117
      yarn.lock

3
next-env.d.ts

@ -1,3 +1,6 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

4
package.json

@ -25,8 +25,8 @@
"@emotion/styled": "^11.3.0",
"@graphql-tools/schema": "^8.1.2",
"@graphql-tools/utils": "^8.1.2",
"apollo-server": "^2.24.0",
"apollo-server-express": "^2.24.0",
"apollo-server": "^3.3.0",
"apollo-server-express": "^3.3.0",
"apollo-upload-client": "^16.0.0",
"bcrypt": "^5.0.1",
"chalk": "^4.1.2",

5
src/server/graphql/directives/auth.tsx

@ -1,4 +1,4 @@
import * as gqlUtils from "@graphql-tools/utils";
import { getDirective, MapperKind, mapSchema } from "@graphql-tools/utils";
import { defaultFieldResolver, GraphQLFieldConfig } from "graphql";
import { ResolverContext } from "miracle-tv-server/types/resolver";
import { any, identity, prop } from "ramda";
@ -9,9 +9,6 @@ import {
AuthorizationError,
} from "miracle-tv-server/graphql/errors/auth";
const { MapperKind, mapSchema } = gqlUtils;
const { getDirective } = gqlUtils as any;
const roleGuard =
(schema: any, directiveName: string) =>
(fieldConfig: GraphQLFieldConfig<any, any>) => {

6
src/server/graphql/index.ts

@ -1,10 +1,9 @@
import { ApolloServer } from "apollo-server-express";
import { gql, makeExecutableSchema } from "apollo-server";
import { gql } from "apollo-server";
import { GraphQLUpload } from "graphql-upload";
import glob from "glob";
import path from "path";
import { DateTime } from "luxon";
import { Resolvers } from "miracle-tv-shared/graphql";
import { connection } from "miracle-tv-server/db/setup-db";
import { readFileSync } from "fs";
import { ResolverContext } from "miracle-tv-server/types/resolver";
@ -59,6 +58,7 @@ import { fileResolvers } from "./resolvers/file";
import { red } from "chalk";
import { DbSession, DbUser } from "miracle-tv-server/db/models/types";
import { authDirective } from "miracle-tv-server/graphql/directives/auth";
import { makeExecutableSchema } from "@graphql-tools/schema";
const schemaString = glob
.sync(path.resolve(__dirname, "./**/*.graphql"))
@ -118,10 +118,8 @@ let executableSchema = makeExecutableSchema({
executableSchema = authDirective(executableSchema, "auth");
export const graphqlEndpoint = new ApolloServer({
uploads: false,
schema: executableSchema,
introspection: true,
playground: true,
formatError: (err) => {
if (err.extensions.code === "INTERNAL_SERVER_ERROR") {
console.error(

2117
yarn.lock
File diff suppressed because it is too large
View File

Loading…
Cancel
Save