Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Add new @override hint for progressive usage #747

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion src/content/shared/overridden-composition-rules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type Product @key(fields: "id") {
<RuleExpansionPanel
title="OVERRIDDEN_FIELD_CAN_BE_REMOVED"
whatItDoes="Checks if a field has been overridden by another subgraph."
rationale="You should consider removing overriden fields to avoid confusion."
rationale="You should consider removing overridden fields to avoid confusion."
>

The following example violates the rule:
Expand Down Expand Up @@ -84,6 +84,50 @@ type Product @key(fields: "id") {

</RuleExpansionPanel>

<RuleExpansionPanel
title="OVERRIDE_MIGRATION_IN_PROGRESS"
whatItDoes="Checks if a field migration is in progress."
rationale="You should complete a field migration."
>

The following example violates the rule:

```graphql title="❌ Subgraph A" disableCopy=true showLineNumbers=false {3}
type Product @key(fields: "id") {
id: ID!
inStock: Boolean! @override(from: "Subgraph B", label: "percent(50)")
}
```

```graphql title="❌ Subgraph B" disableCopy=true showLineNumbers=false {4}
type Product @key(fields: "id") {
id: ID!
name: String!
inStock: Boolean!
}
```

<br/>
After completing the migration, use instead:
<br/>

```graphql title="✅ Subgraph A" disableCopy=true showLineNumbers=false
type Product @key(fields: "id") {
id: ID!
name: String!
inStock: Boolean!
}
```

```graphql title="✅ Subgraph B" disableCopy=true showLineNumbers=false
type Product @key(fields: "id") {
id: ID!
name: String!
}
```

</RuleExpansionPanel>

<RuleExpansionPanel
title="UNUSED_ENUM_TYPE"
whatItDoes="Checks if an enum type is defined but no field or argument in any subgraph references it."
Expand Down
2 changes: 1 addition & 1 deletion src/content/technotes/TN0001-client-id-enforcement.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Together, these pieces of information help teams monitor their graph and make ch

## Enforcing in Apollo Router

The Apollo Router supports client awareness by default if the client sets the `apollographql-client-name` and `apollographql-client-id` in their requests. These values can be overriden using the [router configuration file](/router/managed-federation/client-awareness/) directly.
The Apollo Router supports client awareness by default if the client sets the `apollographql-client-name` and `apollographql-client-id` in their requests. These values can be overridden using the [router configuration file](/router/managed-federation/client-awareness/) directly.

Client headers can also be enforced using a [Rhai script](/router/customizations/rhai) on every incoming request.

Expand Down
Loading