Search in sources :

Example 1 with MissingScalarImplementationError

use of graphql.schema.idl.errors.MissingScalarImplementationError in project graphql-java by graphql-java.

the class SchemaTypeChecker method checkScalarImplementationsArePresent.

private void checkScalarImplementationsArePresent(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, RuntimeWiring wiring) {
    typeRegistry.scalars().forEach((scalarName, scalarTypeDefinition) -> {
        WiringFactory wiringFactory = wiring.getWiringFactory();
        ScalarWiringEnvironment environment = new ScalarWiringEnvironment(typeRegistry, scalarTypeDefinition, Collections.emptyList());
        if (!wiringFactory.providesScalar(environment) && !wiring.getScalars().containsKey(scalarName)) {
            errors.add(new MissingScalarImplementationError(scalarName));
        }
    });
}
Also used : MissingScalarImplementationError(graphql.schema.idl.errors.MissingScalarImplementationError)

Aggregations

MissingScalarImplementationError (graphql.schema.idl.errors.MissingScalarImplementationError)1