-
Notifications
You must be signed in to change notification settings - Fork 178
Description
The Problem
I'm using 0.12.4 of graphql-spqr.
The @GraphQLIgnore annotation does not correctly exclude a field from the generated GraphQL schema when the Java field name starts with an uppercase letter followed by another uppercase letter, e.g., zAiConfigs.
Steps to Reproduce
Consider the following Java data class:
import com.fasterxml.jackson.databind.JsonNode;
import io.leangen.graphql.annotations.GraphQLIgnore;
import lombok.Data;
@Data
public class SimplifiedServerSchema {
private JsonNode apis;
@GraphQLIgnore
private JsonNode zAiConfigs; // Field name starts with 'z', then 'A'
}When the GraphQL schema is generated, the field annotated with @GraphQLIgnore is not excluded.
Actual Behavior
The generated GraphQL schema includes the field ZAiConfigs (or similar casing), indicating that @GraphQLIgnore was not applied:
type SimplifiedServerSchema {
apis: Json
ZAiConfigs: Json # <-- This field should be ignored!
}Expected Behavior
The field annotated with @GraphQLIgnore should be excluded from the generated schema, regardless of its initial casing, as follows:
type SimplifiedServerSchema {
apis: Json
}Observation / Workaround
If the field name is changed to follow standard camelCase naming convention (e.g., starting with a lowercase letter, like zaiConfigs), the annotation works as expected.
Working Example:
import com.fasterxml.jackson.databind.JsonNode;
import io.leangen.graphql.annotations.GraphQLIgnore;
import lombok.Data;
@Data
public class SimplifiedServerSchema {
private JsonNode apis;
@GraphQLIgnore
private JsonNode zaiConfigs; // Changed from zAiConfigs to zaiConfigs
}Generated Schema (Correct):
type SimplifiedServerSchema {
apis: Json
}