@@ -213,7 +213,9 @@ public SchemaGenerator() {
213213 *
214214 * @param typeRegistry this can be obtained via {@link SchemaParser#parse(String)}
215215 * @param wiring this can be built using {@link RuntimeWiring#newRuntimeWiring()}
216+ *
216217 * @return an executable schema
218+ *
217219 * @throws SchemaProblem if there are problems in assembling a schema such as missing type resolvers or no operations defined
218220 */
219221 public GraphQLSchema makeExecutableSchema (TypeDefinitionRegistry typeRegistry , RuntimeWiring wiring ) throws SchemaProblem {
@@ -227,7 +229,9 @@ public GraphQLSchema makeExecutableSchema(TypeDefinitionRegistry typeRegistry, R
227229 * @param options the controlling options
228230 * @param typeRegistry this can be obtained via {@link SchemaParser#parse(String)}
229231 * @param wiring this can be built using {@link RuntimeWiring#newRuntimeWiring()}
232+ *
230233 * @return an executable schema
234+ *
231235 * @throws SchemaProblem if there are problems in assembling a schema such as missing type resolvers or no operations defined
232236 */
233237 public GraphQLSchema makeExecutableSchema (Options options , TypeDefinitionRegistry typeRegistry , RuntimeWiring wiring ) throws SchemaProblem {
@@ -351,6 +355,7 @@ private GraphQLObjectType buildOperation(BuildContext buildCtx, OperationTypeDef
351355 * but then we build the rest of the types specified and put them in as additional types
352356 *
353357 * @param buildCtx the context we need to work out what we are doing
358+ *
354359 * @return the additional types not referenced from the top level operations
355360 */
356361 private Set <GraphQLType > buildAdditionalTypes (BuildContext buildCtx ) {
@@ -368,6 +373,14 @@ private Set<GraphQLType> buildAdditionalTypes(BuildContext buildCtx) {
368373 }
369374 }
370375 });
376+ typeRegistry .scalars ().values ().forEach (scalarTypeDefinition -> {
377+ if (ScalarInfo .isStandardScalar (scalarTypeDefinition .getName ())) {
378+ return ;
379+ }
380+ if (buildCtx .hasInputType (scalarTypeDefinition ) == null && buildCtx .hasOutputType (scalarTypeDefinition ) == null ) {
381+ additionalTypes .add (buildScalar (buildCtx , scalarTypeDefinition ));
382+ }
383+ });
371384 return additionalTypes ;
372385 }
373386
@@ -387,6 +400,7 @@ private Set<GraphQLDirective> buildAdditionalDirectives(BuildContext buildCtx) {
387400 *
388401 * @param buildCtx the context we need to work out what we are doing
389402 * @param rawType the type to be built
403+ *
390404 * @return an output type
391405 */
392406 @ SuppressWarnings ({"unchecked" , "TypeParameterUnusedInFormals" })
0 commit comments