From a1ef9e7b72dcda35061695afa1de727ef5b5bb7f Mon Sep 17 00:00:00 2001 From: Dan Debrunner Date: Sun, 8 Sep 2024 13:34:49 -0400 Subject: [PATCH] chore: fix note format --- reshape/README.md | 2 +- reshape/fields/README.md | 9 ++++----- reshape/subset/README.md | 2 +- routing/supplies/README.md | 8 ++++++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/reshape/README.md b/reshape/README.md index 7f89dc6..83d3ea9 100644 --- a/reshape/README.md +++ b/reshape/README.md @@ -28,7 +28,7 @@ Reshaping is combined with access control of GraphQL fields so that In all of the reshaping examples fields that are part of the reshaped api are accessible with no authorization. -> **Note** +> [!NOTE] > Any reshaped GraphQL schema can also be expanded with any StepZen GraphQL functionality, such as adding fields with `@materializer` or adding `@sequence` fields that invoked fields from reshaped and or original schema. ## Techniques diff --git a/reshape/fields/README.md b/reshape/fields/README.md index b3a9306..01cabdf 100644 --- a/reshape/fields/README.md +++ b/reshape/fields/README.md @@ -11,7 +11,7 @@ This is achieved with a combination of: - Use of `@materializer` for the [new root operation type fields](exposed.graphql). - [Field based access control](config.yaml) to only expose the new fields. -> **Note** +> [!NOTE] > Even though this schema uses `@graphql` the techniques are independent of the data coming from a backend GraphQL endpoint, the reshaping is just against fields in the schema regardless of their source. ## Rename @@ -59,7 +59,7 @@ the `city` field is a leaf `String`, rather than being buried in a `Location` ob [`Query.humanName`](exposed.graphql#L32-L35) uses the selection `human { name }` which selects just a `Human`'s name. It is effectively executing `query ($id:ID!) {human(id:$id) { name }}` when `humanName` is selected in an operation. -[`Query.droidFriends`](exposed.graphql#L37-L40) uses the selection `droid { friends }` where `friends` type is a composite type, `[Character]`. Even though the selected single field `friends` is a composite type, it has no selection in its `@materializer`. Instead, when an operation is executed that selects `droidFriends`, the selection against that field is applied to the selection of `friends`. For example the execution of this operation +[`Query.droidFriends`](exposed.graphql#L37-L40) uses the selection `droid { friends }` where `friends` type is a composite type, `[Character]`. Even though the selected single field `friends` is a composite type, it has no selection in its `@materializer`. Instead, when an operation is executed that selects `droidFriends`, the selection against that field is applied to the selection of `friends`. For example the execution of this operation ```graphql query DroidFriends { @@ -93,7 +93,7 @@ query DroidFriends { } ``` -> **Note** +> [!NOTE] > The selection in the client's operation (`DroidFriends` in this example) against an annotated field with a selection in its `@materializer` can be **any valid selection** against the type of the annotated field, which include selections of nested fields that themselves have `@materializer`, with or without selections. If anywhere in the selection any field is a list then the annotated field must have a type that is a list of the single field. @@ -121,5 +121,4 @@ stepzen request -f operations.graphql --operation-name=DroidFriends -H Authoriza stepzen request -f operations.graphql --operation-name=HumanFriendsNames -H Authorization: ``` -> **Note** -> `-H Authorization:` removes the authorization header automatically added by `stepzen request` to demonstrate the fields are public. +> [!NOTE] > `-H Authorization:` removes the authorization header automatically added by `stepzen request` to demonstrate the fields are public. diff --git a/reshape/subset/README.md b/reshape/subset/README.md index 2728a35..b65c43c 100644 --- a/reshape/subset/README.md +++ b/reshape/subset/README.md @@ -87,4 +87,4 @@ stepzen request -f operations.graphql --operation-name=Human -H Authorization: stepzen request -f operations.graphql --operation-name=Version -H Authorization: ``` -> **Note** > `-H Authorization:` removes the authorization header automatically added by `stepzen request` to demonstrate the fields are public. +> [!NOTE] > `-H Authorization:` removes the authorization header automatically added by `stepzen request` to demonstrate the fields are public. diff --git a/routing/supplies/README.md b/routing/supplies/README.md index dba3e84..8aeadc0 100644 --- a/routing/supplies/README.md +++ b/routing/supplies/README.md @@ -14,9 +14,11 @@ based upon a condition against its field arguments. ## Example The abstract field in `Query` is: + ```graphql expected(id:ID):Delivery ``` + which given a tracking identifier returns when a package is expected. It is supplied by three fields, each with a condition. @@ -29,7 +31,8 @@ It is supplied by three fields, each with a condition. tyd(id: ID!): ToYourDoor @supplies(query: "expected" if: {src: "$contains(id, /^TYD-/)", language: JSONATA}) ``` -> **Note** + +> [!NOTE] > Implementation of the fields (`@rest`) have been omitted for brevity. The script `src` must be ECMAScript 5.1 or JSONata and the field's arguments @@ -42,11 +45,12 @@ Thus in this example if the tracking identifier starts with `FP-` a call is made to the FastPackage REST api, if it starts with `ROS-` a call to the `RainOrShine` REST api is called, `TYD-` a call to the To Your Door API otherwise no call is made. -> **Note** +> [!NOTE] > The supplying fields can have any implementation, FastPackage could > be a GraphQL endpoint while RainOrShine a database query. ## Try it out + Login to your StepZen account, deploy the schema and then issue requests. ```shell