Skip to content

Schema directives do not support EnumValue arguments #1500

@lkorth

Description

@lkorth

Schema directives currently only support built in scalars, are there any plans to add support for enums or any reason I shouldn't take a crack at adding them?

/**
* We support the basic types as directive types
*
* @param value the value to use
*
* @return a graphql input type
*/
public GraphQLInputType buildDirectiveInputType(Value value) {
if (value instanceof NullValue) {
return Scalars.GraphQLString;
}
if (value instanceof FloatValue) {
return Scalars.GraphQLFloat;
}
if (value instanceof StringValue) {
return Scalars.GraphQLString;
}
if (value instanceof IntValue) {
return Scalars.GraphQLInt;
}
if (value instanceof BooleanValue) {
return Scalars.GraphQLBoolean;
}
if (value instanceof ArrayValue) {
ArrayValue arrayValue = (ArrayValue) value;
return list(buildDirectiveInputType(getArrayValueWrappedType(arrayValue)));
}
return assertShouldNeverHappen("Directive values of type '%s' are not supported yet", value.getClass().getSimpleName());
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions