Search in sources :

Example 1 with TypeExtensionEnumValueRedefinitionError

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

the class SchemaTypeExtensionsChecker method checkForEnumValueRedefinition.

private void checkForEnumValueRedefinition(List<GraphQLError> errors, TypeDefinition typeDefinition, List<EnumValueDefinition> enumValueDefinitions, List<EnumValueDefinition> referenceEnumValueDefinitions) {
    Map<String, EnumValueDefinition> referenceMap = FpKit.getByName(referenceEnumValueDefinitions, EnumValueDefinition::getName, mergeFirst());
    enumValueDefinitions.forEach(fld -> {
        if (referenceMap.containsKey(fld.getName())) {
            errors.add(new TypeExtensionEnumValueRedefinitionError(typeDefinition, fld));
        }
    });
}
Also used : EnumValueDefinition(graphql.language.EnumValueDefinition) TypeExtensionEnumValueRedefinitionError(graphql.schema.idl.errors.TypeExtensionEnumValueRedefinitionError)

Aggregations

EnumValueDefinition (graphql.language.EnumValueDefinition)1 TypeExtensionEnumValueRedefinitionError (graphql.schema.idl.errors.TypeExtensionEnumValueRedefinitionError)1