@@ -68,27 +68,28 @@ export class GraphQLSchema {
68
68
69
69
invariant (
70
70
config . query instanceof GraphQLObjectType ,
71
- `Schema query must be Object Type but got: ${ config . query } .`
71
+ `Schema query must be Object Type but got: ${
72
+ String ( config . query ) } .`
72
73
) ;
73
74
this . _queryType = config . query ;
74
75
75
76
invariant (
76
77
! config . mutation || config . mutation instanceof GraphQLObjectType ,
77
78
`Schema mutation must be Object Type if provided but got: ${
78
- config . mutation } .`
79
+ String ( config . mutation ) } .`
79
80
) ;
80
81
this . _mutationType = config . mutation ;
81
82
82
83
invariant (
83
84
! config . subscription || config . subscription instanceof GraphQLObjectType ,
84
85
`Schema subscription must be Object Type if provided but got: ${
85
- config . subscription } .`
86
+ String ( config . subscription ) } .`
86
87
) ;
87
88
this . _subscriptionType = config . subscription ;
88
89
89
90
invariant (
90
91
! config . types || Array . isArray ( config . types ) ,
91
- `Schema types must be Array if provided but got: ${ config . types } .`
92
+ `Schema types must be Array if provided but got: ${ String ( config . types ) } .`
92
93
) ;
93
94
94
95
invariant (
@@ -97,7 +98,7 @@ export class GraphQLSchema {
97
98
directive => directive instanceof GraphQLDirective
98
99
) ,
99
100
`Schema directives must be Array<GraphQLDirective> if provided but got: ${
100
- config . directives } .`
101
+ String ( config . directives ) } .`
101
102
) ;
102
103
// Provide specified directives (e.g. @include and @skip) by default.
103
104
this . _directives = config . directives || specifiedDirectives ;
@@ -190,8 +191,8 @@ export class GraphQLSchema {
190
191
const possibleTypes = this . getPossibleTypes ( abstractType ) ;
191
192
invariant (
192
193
Array . isArray ( possibleTypes ) ,
193
- `Could not find possible implementing types for ${ abstractType } in ` +
194
- 'schema. Check that schema.types is defined and is an array of ' +
194
+ `Could not find possible implementing types for ${ abstractType . name } ` +
195
+ 'in schema. Check that schema.types is defined and is an array of ' +
195
196
'all possible types in the schema.'
196
197
) ;
197
198
possibleTypeMap [ abstractType . name ] =
@@ -234,7 +235,7 @@ function typeMapReducer(map: TypeMap, type: ?GraphQLType): TypeMap {
234
235
invariant (
235
236
map [ type . name ] === type ,
236
237
'Schema must contain unique named types but contains multiple ' +
237
- `types named "${ type } ".`
238
+ `types named "${ type . name } ".`
238
239
) ;
239
240
return map ;
240
241
}
0 commit comments