Skip to content

Implement unions in GQL #29425

Closed
Closed
@magento-engcom-team

Description

@magento-engcom-team

Implement unions in graphql

As a developer I want to be able to implement unions in the Magento graphql schema language following the specification https://spec.graphql.org/June2018/#sec-Unions

Acceptance criteria:
allow a syntax like the following:

union CompanyStructureEntity 
@doc(description: "some kind of union") 
@typeResolver(class: "Magento\\Module\\Resolver")  =
    CompanyTeam | Customer
{code}



Allow and resolve a query with proper types representing each type in union like the following:
{code:java}
{
  company {
    structure {
      items {
        id
        parent_id
        entity {
          __typename
          ... on Customer {
            firstname
            lastname
          }
          ... on CompanyTeam {
            name
          }
        }
      }
    }
  }
}

Metadata

Metadata

Assignees

Labels

Issue: Format is not validGate 1 Failed. Automatic verification of issue format is failedPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions