Skip to content
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
5 changes: 5 additions & 0 deletions src/directory/directory.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,11 @@ export const directory = {
route: '/cli/graphql/schema-evolution',
filters: []
},
{
title: 'Directives reference',
route: '/cli/graphql/directives-reference',
filters: []
},
{
title: 'JavaScript, Java, Swift code generation',
route: '/cli/graphql/client-code-generation',
Expand Down
22 changes: 22 additions & 0 deletions src/pages/cli/graphql/directives-reference.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export const meta = {
title: `Directives reference`,
description: `A reference document of all Amplify-provided GraphQL directives that enhance your Amplify app's GraphQL API + database`,
};

The Amplify CLI provides GraphQL directives to enhance your schema with additional capabilities such as custom indexes, authorization rules, function triggers, and more.

|Directive|Description|
|---------|-----------|
|[`@model`](/cli/graphql/data-modeling)|Defines top level object types in your API that are backed by Amazon DynamoDB|
|[`@primaryKey`](/cli/graphql/data-modeling/#configure-a-primary-key)| Configures custom primary key for @model types|
|[`@index`](/cli/graphql/data-modeling/#configure-a-secondary-index)| Configures custom secondary index structures for @model types|
|[`@auth`](/cli/graphql/authorization-rules/)| Defines authorization rules for your @model types and fields|
|[`@hasOne`](/cli/graphql/data-modeling/#has-one-relationship)| Create a one-directional one-to-one relationship between two models. For example, a Project "has one" Team. This allows you to query the team from the project record|
|[`@hasMany`](/cli/graphql/data-modeling/#has-many-relationship)| Create a one-directional one-to-many relationship between two models. For example, a Post has many comments. This allows you to query all the comments from the post record|
|[`@belongsTo`](/cli/graphql/data-modeling/#belongs-to-relationship)| Use a "belongs to" relationship to make a "has one" or "has many" relationship bi-directional. For example, a Project has one Team and a Team belongs to a Project. This allows you to query the team from the project record and vice versa|
|[`@manyToMany`](/cli/graphql/data-modeling/#many-to-many-relationship)| Configures a "join table" between two models to facilitate a many-to-many relationship. For example, a Blog has many Tags and a Tag has many Blogs|
|[`@function`](/cli/graphql/custom-business-logic/#lambda-function-resolver)| Configures a Lambda function resolvers for a field|
|[`@http`](/cli/graphql/custom-business-logic/#http-resolver)| Configures an HTTP resolver for a field|
|[`@predictions`](/cli/graphql/connect-to-machine-learning-services/)| Queries an orchestration of AI/ML services such as Amazon Rekognition, Amazon Translate, and/or Amazon Polly|
|[`@searchable`](/cli/graphql/search-and-result-aggregations/)| Makes your data searchable by streaming it to Amazon OpenSearch|
|[`@mapsTo`](/cli/graphql/schema-evolution/)|Once a table contains production data that cannot be deleted, `@mapsTo` can be used to specify the original name||
2 changes: 1 addition & 1 deletion src/pages/cli/graphql/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const meta = {
title: `Overview`,
description: `Add authorization rules to your GraphQL schema to control access to your data.`,
description: `Add a GraphQL API + database to your Amplify app using the Amplify CLI`,
};

<MigrationAlert url={"/cli-legacy/graphql-transformer/overview"}/>
Expand Down