Skip to content

FieldVisibilitySchemaTransformation code has trouble with remove fields under certain conditions #4191

@bbakerman

Description

@bbakerman

Describe the bug
Atlassian recently encountered a bug where the FieldVisibilitySchemaTransformation code seemed to produce and invalid schema after transformation.

To Reproduce

Right now we dont have a public reproduction yet but we dont have local .graphqls files of the starting schema and code like

 override fun isVisible(environment: VisibleFieldPredicateEnvironment): Boolean {
        if (schemaElement !is GraphQLFieldDefinition) {
            return true
        }
        val parent = environment.parentElement as GraphQLFieldsContainer
        val directiveContainer = (environment.schemaElement as GraphQLDirectiveContainer)
        return when {
            parent.name == "Query" && schemaElement.name == "admin_effectiveRoleAssignmentsByPrincipal"
                -> false
            parent.name == "Query" && schemaElement.name == "admin_group"
                -> false
            else -> true
        }
    }

I need to make sure we can publish the .graphqls schema ok here for reproduction

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