Skip to content

Commit

Permalink
Merge pull request #1183 from serlo/remove-plugin
Browse files Browse the repository at this point in the history
refactor: Remove invalid-current-value-error-plugin.ts
  • Loading branch information
hugotiburtino authored Dec 5, 2023
2 parents 3ae3f66 + 0212322 commit 1c6726a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 83 deletions.
4 changes: 1 addition & 3 deletions __tests__/__utils__/assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ export class Client {
this.context = context
this.apolloServer = new ApolloServer<
Partial<Pick<Context, 'service' | 'userId'>>
>({
...getGraphQLOptions(createTestEnvironment()),
})
>(getGraphQLOptions())
}

prepareQuery<I extends Input = Input, V extends Variables<I> = Variables<I>>(
Expand Down
7 changes: 2 additions & 5 deletions packages/server/src/internals/server/graphql-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ import {
} from '~/internals/authentication'
import { Cache } from '~/internals/cache'
import { ModelDataSource } from '~/internals/data-source'
import { Environment } from '~/internals/environment'
import { Context } from '~/internals/graphql'
import { createSentryPlugin } from '~/internals/sentry'
import { createInvalidCurrentValueErrorPlugin } from '~/internals/server/invalid-current-value-error-plugin'
import { SwrQueue } from '~/internals/swr-queue'
import { schema } from '~/schema'

Expand All @@ -40,7 +38,7 @@ export async function applyGraphQLMiddleware({
}) {
const graphQLPath = '/graphql'
const environment = { cache, swrQueue, authServices }
const server = new ApolloServer<Context>(getGraphQLOptions(environment))
const server = new ApolloServer<Context>(getGraphQLOptions())
await server.start()

app.use(json({ limit: '2mb' }))
Expand Down Expand Up @@ -95,7 +93,7 @@ export async function applyGraphQLMiddleware({
return graphQLPath
}

export function getGraphQLOptions(environment: Environment) {
export function getGraphQLOptions() {
return {
typeDefs: schema.typeDefs,
resolvers: schema.resolvers,
Expand All @@ -104,7 +102,6 @@ export function getGraphQLOptions(environment: Environment) {
plugins: [
// We add the playground via express middleware in src/index.ts
ApolloServerPluginLandingPageDisabled(),
createInvalidCurrentValueErrorPlugin({ environment }),
createSentryPlugin(),
],
formatError(error: GraphQLFormattedError) {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion packages/server/src/schema/uuid/abstract-uuid/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function isSupportedUuid(
)
}

export function isSupportedUuidType(name: string) {
function isSupportedUuidType(name: string) {
return R.includes(name, validTypes)
}

Expand Down

0 comments on commit 1c6726a

Please sign in to comment.