Join us from October 8-10 in New York City to learn the latest tips, trends, and news about GraphQL Federation and API platform engineering.Join us for GraphQL Summit 2024 in NYC
Docs
Start for Free

Composition Hints

Reference for composition hints


When you successfully compose the schemas provided by your subgraphs into a , the process can flag potential improvements or hints. Hints are violations of the GraphOS schema linter's composition rules. You can review them on the Checks page in or via the Rover CLI.

NOTE

hints only appear in GraphOS Studio and via the rover subgraph check command for on federation version 2.4 or later. You can update a 's version from its Settings page in GraphOS Studio.

The rover subgraph check command outputs rule violations with the severity levels you've configured for your graph . The rover supergraph compose command outputs rule violations for all local .

See below for a list of composition rules categorized by rule type. The heading for each rule is the code that returns for the rule violation. Refer to the rules reference page for a comprehensive list of linter rules.

Inconsistent elements

These rules identity inconsistencies in , types, , etc across . Such inconsistencies can disrupt or even break composition.

Compatibility

In some cases, inconsistency rules also indicate the compatibility of checked types. Two types are compatible if one is a non-nullable version, a list version, a subtype, or a combination of any of these of the other.

For example, the price fields in the example subgraphs below are inconsistent and incompatible because they use completely different types (Float vs String):

Subgraph A
type Product {
id: ID!
name: String
price: Float
}
Subgraph B
type Product {
id: ID!
name: String
price: String
}

These price fields in the example subgraphs below are inconsistent but compatible since both use Floats, but one is nullable and the other is the non-nullable list of Floats.

Subgraph A
type Product {
id: ID!
name: String
price: Float
}
Subgraph B
type Product {
id: ID!
name: String
price: [Float]!
}

Overridden and unused elements

Directives

Previous
Error Codes
Next
Federated Trace Data
Rate articleRateEdit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc., d/b/a Apollo GraphQL.

Privacy Policy

Company