Skip to content

Commit

Permalink
Docs: Fix article
Browse files Browse the repository at this point in the history
  • Loading branch information
robertjdominguez committed May 20, 2024
1 parent 5e1e351 commit 44d9cb1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/graphql-api/apollo-federation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ seoFrontMatterUpdated: true
---

## Introduction
Hasura DDN itself can be used as a subgraph in an supergraph created by

Hasura DDN itself can be used as a subgraph in a supergraph created by
[Apollo Federation](https://www.apollographql.com/docs/federation/).

Apollo Federation is a way to compose multiple GraphQL services (called subgraphs) into a unified API (called a
supergraph).

:::info Supergraphs and Subgraph terminology in Hasura DDN and Apollo Federation

Some of the naming used in Apollo Federation conflicts with the same names used in Hasura. Here is a quick glossary
to help you understand the terms better:
Some of the naming used in Apollo Federation conflicts with the same names used in Hasura. Here is a quick glossary to
help you understand the terms better:

| Term | Hasura | Apollo Federation |
|------------|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| ---------- | ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| Subgraph | A subgraph in Hasura is the notion of a module of Hasura supergraph metadata. | A subgraph in Apollo Federation is a **standalone GraphQL service.** |
| Supergraph | A supergraph in Hasura is the collection of subgraph metadata and the resultant GraphQL API that is created. | A supergraph in Apollo Federation is a unified GraphQL API that is created by stitching multiple subgraph APIs. |

Expand All @@ -40,7 +41,6 @@ Hasura DDN is compliant with the
[Apollo Federation subgraph specification](https://www.apollographql.com/docs/federation/subgraph-spec/), so you can
plug Hasura DDN in as a subgraph in your Apollo federated supergraph.


```mermaid
graph LR;
clients(Clients);
Expand Down Expand Up @@ -81,11 +81,11 @@ definition:
## Marking a Type as an Apollo Entity

Types defined in Hasura DDN can also be marked as
[Apollo Entities](https://www.apollographql.com/docs/federation/entities/). This will allow the same type to be
resolved from DDN (and your other subgraphs that defines the type) as well.
[Apollo Entities](https://www.apollographql.com/docs/federation/entities/). This will allow the same type to be resolved
from DDN (and your other subgraphs that defines the type) as well.

To mark a type as an entity, you will have to edit the metadata for the `ObjectType` and the `Model` which will be
used to resolve the type.
To mark a type as an entity, you will have to edit the metadata for the `ObjectType` and the `Model` which will be used
to resolve the type.

1. Add the keys for the `ObjectType`. The [keys](https://www.apollographql.com/docs/federation/entities/#1-define-a-key)
can be defined as following in the
Expand All @@ -95,7 +95,7 @@ used to resolve the type.
apolloFederation:
keys: # The fields that uniquely identifies the entity
- fields:
- id
- id
```

2. Mark the `Model` that should act as the source for the entity. This can be done by adding the following in the
Expand Down

0 comments on commit 44d9cb1

Please sign in to comment.