Skip to main content
In a federated graph, different subgraphs may define the same field on different concrete union member types with differing nullability. For example, one subgraph might define upc: ID! on Cosmo while another defines upc: ID (nullable) on Consultancy, both members of a Products union. By default, the router rejects queries that select such fields across union members with a validation error like:
The relax_subgraph_operation_field_selection_merging_nullability option relaxes this validation when the enclosing types are non-overlapping concrete object types (i.e., different union members). This is useful when subgraphs legitimately disagree on nullability for the same field.

Examples

Scalar fields with differing nullability

Given two union member types where upc has different nullability:
The following query selects upc on both types:
Default behavior: The router rejects this with a field conflict error. With relaxed nullability enabled: The query is accepted because Consultancy and Cosmo are non-overlapping concrete types — a result can only ever be one or the other.

Object fields with differing nullability

The same applies to object-typed fields:
Default behavior: The router rejects this with a type conflict error. With relaxed nullability enabled: The query is accepted.

Configuration

This option is disabled by default. It only affects validation of field selections where the enclosing inline fragment types are non-overlapping concrete union members. See the Router Configuration reference for all engine flags.