-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
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?
graphql-java/src/main/java/graphql/schema/idl/SchemaGeneratorHelper.java
Lines 155 to 183 in bd9240c
| /** | |
| * 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()); | |
| } |
LovisaLugnegard, craone, AnkBurov and xinghai-zhang
Metadata
Metadata
Assignees
Labels
No labels