diff --git a/src/directory/directory.mjs b/src/directory/directory.mjs index 467a0cf4540..d41f25f2b98 100644 --- a/src/directory/directory.mjs +++ b/src/directory/directory.mjs @@ -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', diff --git a/src/pages/cli/graphql/directives-reference.mdx b/src/pages/cli/graphql/directives-reference.mdx new file mode 100644 index 00000000000..8b1137d4245 --- /dev/null +++ b/src/pages/cli/graphql/directives-reference.mdx @@ -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|| \ No newline at end of file diff --git a/src/pages/cli/graphql/overview.mdx b/src/pages/cli/graphql/overview.mdx index 273d70b7093..9d57f7a4158 100644 --- a/src/pages/cli/graphql/overview.mdx +++ b/src/pages/cli/graphql/overview.mdx @@ -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`, };