diff --git a/modules/ROOT/pages/authentication-and-authorization/authorization.adoc b/modules/ROOT/pages/authentication-and-authorization/authorization.adoc index 4fab80aa..95e1784d 100644 --- a/modules/ROOT/pages/authentication-and-authorization/authorization.adoc +++ b/modules/ROOT/pages/authentication-and-authorization/authorization.adoc @@ -2,8 +2,8 @@ :description: This page describes how to set up authorization features in the Neo4j GraphQL Library. = Authorization -Authorization rules cover what specific data a generated Cypher query is executed against. -They use predicates to evaluate the Cypher generated from a GraphQL query, thus allowing or disallowing execution within the context of nodes and their properties. +Authorization rules cover to what specific data a generated Cypher query is executed against. +They use predicates to evaluate the Cypher generated from a GraphQL query, thus allowing or not execution within the context of nodes and their properties. All authorization rules have an implied requirement for authentication, given that the rules are normally evaluated against values in the JWT payload. @@ -63,7 +63,7 @@ type User @authorization(validate: [ Authentication is implicitly required for every authorization check by default, but this can be disabled on a per-rule basis. This could be the case, for instance, when a node has a property which flags whether the node should be public or not. -For instance, in the case where some `Post` nodes are private and belong to a particular `User`, while other `Post` nodes are public and readable by any user, here is how to set this up: +For instance, in case `Post` nodes might be private and belong to a particular `User`, or be public and readable by any user, here is how to set this up: [source, graphql, indent=0] ---- diff --git a/modules/ROOT/pages/authentication-and-authorization/index.adoc b/modules/ROOT/pages/authentication-and-authorization/index.adoc index f51c7a3e..de1e16d7 100644 --- a/modules/ROOT/pages/authentication-and-authorization/index.adoc +++ b/modules/ROOT/pages/authentication-and-authorization/index.adoc @@ -6,10 +6,10 @@ auth/authorization/allow.adoc, auth/authorization/bind.adoc, auth/authorization/ auth/authorization/where.adoc, guides/v4-migration/authorization.adoc [WARNING] -=== +==== The `@auth` directive has been replaced by `@authentication` and `@authorization`. See the xref::migration/v4-migration/authorization.adoc[Migration guide] for details on how to upgrade. -=== +==== * xref::authentication-and-authorization/authentication.adoc[Authentication] - Explicit authentication, configured using the `@authentication` directive. * xref::authentication-and-authorization/authorization.adoc[Authorization] - Authorization rules set using the `@authorization` directive. diff --git a/modules/ROOT/pages/integrations/apollo-federation.adoc b/modules/ROOT/pages/integrations/apollo-federation.adoc index 0882c0fc..5011d2a4 100644 --- a/modules/ROOT/pages/integrations/apollo-federation.adoc +++ b/modules/ROOT/pages/integrations/apollo-federation.adoc @@ -1,4 +1,5 @@ [[apollo-federation]] +:description: This guide shows how to create a subgraph using the Neo4j GraphQL Library. = Apollo Federation :page-aliases: guides/apollo-federation.adoc :description: This guide shows how to create a subgraph using the Neo4j GraphQL Library, for composition into a supergraph using Apollo Federation. @@ -65,18 +66,19 @@ npm pkg set type="module" ---- + [NOTE] -=== +==== This how-to guide sets up the project using ES Modules, which allows the usage of features such as top-level `await`. -=== +==== . Choose TypeScript or JavaScript to proceed with the setup: -+ + [.tabbed-example] ==== [.include-with-Typescript] ===== -. Create a `src` directory with an empty `index.ts` file to contain the entrypoint to your code: + +. Create a src directory with an empty index.ts file to contain the entrypoint to your code: + [source, bash] ---- @@ -91,14 +93,14 @@ touch src/index.ts npm install --save-dev typescript @types/node @tsconfig/node-lts ---- + -. Create an empty `tsconfig.json` file containing the compiler configuration for TypeScript: +. Create an empty tsconfig.json file containing the compiler configuration for TypeScript: + [source, bash] ---- touch tsconfig.json ---- + -. Add the following configuration to the `tsconfig.json` file: +. Add the following configuration to the tsconfig.json file: + [source, json] ---- @@ -112,12 +114,12 @@ touch tsconfig.json ---- + [NOTE] -=== -This configuration extends the https://github.com/tsconfig/bases#node-lts-tsconfigjson[community base for Node.js LTS], provided by the `@tsconfig/node-lts` package installed above. +====== +This configuration extends the https://github.com/tsconfig/bases#node-lts-tsconfigjson[community base for Node.js LTS], provided by the @tsconfig/node-lts package installed above. For more information on the available options, see the https://www.typescriptlang.org/tsconfig[TypeScript Compiler docs]. -=== +====== + -. Replace the default `scripts` entry in your `package.json` file with the following: +. Replace the default scripts entry in your package.json file with the following: + [source, json] ---- @@ -134,16 +136,17 @@ For more information on the available options, see the https://www.typescriptlan [.include-with-JavaScript] ===== -. Create a `src` directory with an empty `index.js` file to contain the entrypoint to your code: -+ + +Create a `src` directory with an empty `index.js` file to contain the entrypoint to your code: + [source, bash] ---- mkdir src touch src/index.js ---- -+ -. Replace the default `scripts` entry in your `package.json` file with the following: -+ + +Replace the default `scripts` entry in your `package.json` file with the following: + [source, json] ---- { @@ -155,7 +158,9 @@ touch src/index.js } ---- ===== + ==== + + . This guide requires the installation of the following dependencies: + @@ -190,10 +195,10 @@ const typeDefs = `#graphql ---- [NOTE] -=== +==== This example only includes the Federation `@key` directive. To use more https://www.apollographql.com/docs/federation/federated-types/federated-directives[Federation directives], add them to the `import` array. -=== +==== == Define an entity @@ -269,4 +274,4 @@ For further iteration, this subgraph can also be composed into a supergraph. Check Apollo's guides for more instructions: * https://www.apollographql.com/docs/federation/quickstart/studio-composition[Composition in Apollo Studio] -* https://www.apollographql.com/docs/federation/quickstart/local-composition[Local composition] +* https://www.apollographql.com/docs/federation/quickstart/local-composition[Local composition] \ No newline at end of file diff --git a/modules/ROOT/pages/subscriptions/events.adoc b/modules/ROOT/pages/subscriptions/events.adoc index 155d0b38..644da9fb 100644 --- a/modules/ROOT/pages/subscriptions/events.adoc +++ b/modules/ROOT/pages/subscriptions/events.adoc @@ -16,7 +16,7 @@ Changes made directly to the database or using the xref::type-definitions/direct == `CREATE` Subscriptions to `CREATE` events listen *only* to newly created nodes, not new relationships. -In this case, a new event is triggered for each new node, containing its properties. +In this occasion, a new event is triggered for each new node, containing its properties. This action is performed with the top-level subscription `[type]Created`, which contains the following fields: @@ -160,9 +160,9 @@ subscription { Subscriptions to `CREATE_RELATIONSHIP` events listen for newly created relationships to a node of the specified type. [NOTE] -=== +==== This subscription operation is **only** available for types that define relationship fields. -=== +==== == `CREATE_RELATIONSHIP` @@ -175,10 +175,10 @@ These events: * Contain the properties of the nodes connected through the relationship, as well as the properties of the new relationship, if any. [NOTE] -=== +==== Connected nodes that may or may not have previously existed are not covered by this subscription. To subscribe to these nodes' updates, use the xref:subscriptions/events.adoc#_create[`CREATE`] or the xref:subscriptions/events.adoc#_update[`UPDATE`] subscription. -=== +==== Subscriptions to `CREATE_RELATIONSHIP` events can be made with the top-level subscription `[type]RelationshipCreated`, which contains the following fields: @@ -192,10 +192,10 @@ While any event unrelated to `relationshipFieldName` should be `null`, the ones Only top-level properties, without relationships, are available and they are the properties that already existed before the `CREATE_RELATIONSHIP` operation took place. [NOTE] -=== +==== Irrespective of the relationship direction in the database, the `CREATE_RELATIONSHIP` event is bound to the type targeted for the subscription. Consequently, if types A and B have xref:subscriptions/events.adoc#create-non-reciprocal-relationships[non-reciprocal relationships] and a GraphQL operation creates a relationship between them (despite being already previously connected in the database), the `CREATE_RELATIONSHIP` event should only return the subscription to the type A. -=== +==== As an example, consider the following type definitions: @@ -1007,10 +1007,10 @@ This object should be populated with properties according to the deleted relatio * Contains the properties of the nodes connected through the relationship, as well as the properties of the newly deleted relationship, if any. [NOTE] -=== +==== Disconnected nodes that may or may not have been deleted in the process are not covered by this subscription. To subscribe to these nodes' updates, use the `DELETE` subscriptions. -=== +==== Subscriptions to `DELETE_RELATIONSHIP` events can be made with the top-level subscription `[type]RelationshipDeleted`, which contains the following fields: @@ -1023,10 +1023,10 @@ While any event unrelated to `relationshipFieldName` should be `null`, the ones Only top-level properties, without relationships, are available and they are the properties that already existed before the `DELETE_RELATIONSHIP` operation took place. [NOTE] -=== +==== Irrespective of the relationship direction in the database, the `DELETE_RELATIONSHIP` event is bound to the type targeted for the subscription. Consequently, if types A and B have xref:subscriptions/events.adoc#delete-non-reciprocal-relationships[non-reciprocal relationships] and a GraphQL operation deletes a relationship between them (despite being already previously diconnected in the database), the `DELETE_RELATIONSHIP` event should only return the subscription to the type A. -=== +==== As an example, consider these type definitions: diff --git a/modules/ROOT/pages/type-definitions/types/scalar.adoc b/modules/ROOT/pages/type-definitions/types/scalar.adoc index 67315112..c3f40b20 100644 --- a/modules/ROOT/pages/type-definitions/types/scalar.adoc +++ b/modules/ROOT/pages/type-definitions/types/scalar.adoc @@ -43,7 +43,7 @@ query { ---- | `Float` -| Placeholder text to make the table prettier. +| Represents signed double‐precision fractional values. a| [source, graphql, indent=0] ---- @@ -63,7 +63,7 @@ type Product { ---- | `Boolean` -| Placeholder text to make the table prettier. +| Represents `true` or `false`. a| [source, graphql, indent=0] ---- @@ -80,4 +80,4 @@ type Product { id: ID! } ---- -|=== \ No newline at end of file +|=== diff --git a/modules/ROOT/partials/reusing-content.adoc b/modules/ROOT/partials/reusing-content.adoc index 464c8ddc..52df337f 100644 --- a/modules/ROOT/partials/reusing-content.adoc +++ b/modules/ROOT/partials/reusing-content.adoc @@ -1 +1,2 @@ +[[include-typescript]] This paragraph can be used anywhere with the syntax shown in xref:content-types.adoc#_partials[]. \ No newline at end of file