Skip to content

@GraphQLIgnore on field with initial uppercase letter is ignored (e.g., ZAiConfigs) #534

@Ryokki

Description

@Ryokki

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
}

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