Skip to content

Commit

Permalink
docs: context directives are enterprise features (#3025)
Browse files Browse the repository at this point in the history
Add Enterprise feature callouts for context directives

Co-authored-by: Chris Lenfest <clenfest@apollographql.com>
  • Loading branch information
shorgi and clenfest authored Jun 11, 2024
1 parent 23bc21e commit 909be13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/source/entities-advanced.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,12 @@ This problem is not limited to reference resolvers. In fact, it can occur with a

</MinVersion>

<EnterpriseFeature>

The `@context` and `@fromContext` directives are [Enterprise features](/router/enterprise-features) of the Apollo Router and require an organization with a [GraphOS Enterprise plan](https://www.apollographql.com/pricing/). If your organization doesn't have an Enterprise plan, you can test it out by signing up for a free [Enterprise trial](/graphos/org/plans/#enterprise-trials).

</EnterpriseFeature>

Use the `@context` and `@fromContext` directives to set and get a _context_ to share data between types in a subgraph. Contexts provide a way for a subgraph to share data between types of a nested-type hierarchy without overloading entity keys with extraneous fields. Contexts also preserve the separation of concerns between different subgraphs.

In an entity, a nested object may have a dependency on an ancestor type and thus need access to that ancestor's field(s).
Expand Down
4 changes: 4 additions & 0 deletions docs/source/federated-types/federated-directives.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,8 @@ If different subgraphs use different versions of a directive's corresponding spe

</MinVersion>

<EnterpriseFeature />

The `@context` directive defines a named context from which a field of the annotated type can be passed to a receiver of the context. The receiver must be a field annotated with the `@fromContext` directive.

```graphql
Expand Down Expand Up @@ -957,6 +959,8 @@ type U @key(fields: "id") {

</MinVersion>

<EnterpriseFeature />

The `@fromContext` directive sets the context from which to receive the value of the annotated field. The context must have been defined with the `@context` directive.

```graphql
Expand Down

0 comments on commit 909be13

Please sign in to comment.