core: add Scalar Upload with schema is made execuable

This commit is contained in:
Evans Hauser 2018-06-14 15:58:23 -07:00
parent 1f9f307d55
commit 439ec44135
No known key found for this signature in database
GPG key ID: 88AF586817F52EEC

View file

@ -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,
}); });