mirror of
https://github.com/vale981/apollo-server
synced 2025-03-05 17:51:40 -05:00
core: add Scalar Upload with schema is made execuable
This commit is contained in:
parent
1f9f307d55
commit
439ec44135
1 changed files with 9 additions and 1 deletions
|
@ -40,6 +40,8 @@ import {
|
||||||
SubscriptionServerOptions,
|
SubscriptionServerOptions,
|
||||||
} from './types';
|
} from './types';
|
||||||
|
|
||||||
|
import { gql } from './index';
|
||||||
|
|
||||||
const NoIntrospection = (context: ValidationContext) => ({
|
const NoIntrospection = (context: ValidationContext) => ({
|
||||||
Field(node: FieldDefinitionNode) {
|
Field(node: FieldDefinitionNode) {
|
||||||
if (node.name.value === '__schema' || node.name.value === '__type') {
|
if (node.name.value === '__schema' || node.name.value === '__type') {
|
||||||
|
@ -125,7 +127,13 @@ export class ApolloServerBase {
|
||||||
this.schema = schema
|
this.schema = schema
|
||||||
? schema
|
? schema
|
||||||
: makeExecutableSchema({
|
: makeExecutableSchema({
|
||||||
typeDefs,
|
//we add in the upload scalar, so that schemas that don't include it
|
||||||
|
//won't error when we makeExecutableSchema
|
||||||
|
typeDefs: [
|
||||||
|
gql`
|
||||||
|
scalar Upload
|
||||||
|
`,
|
||||||
|
].concat(typeDefs),
|
||||||
schemaDirectives,
|
schemaDirectives,
|
||||||
resolvers,
|
resolvers,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue