-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(website): g.rest
reference at /docs/reference/rest
#734
Conversation
@coderabbitai review |
WalkthroughThe recent changes enhance the documentation for REST API interaction within Metatype. A reference to the REST section was added to the guides, and a comprehensive new file was introduced in the reference section. This new documentation includes detailed examples in Python and TypeScript, explanations of query types, dynamic queries, and instructions on accessing auto-generated endpoint documentation and OpenAPI specifications. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
@@ -22,4 +22,6 @@ The effect of the root materializer accessed in the query determines the HTTP ve | |||
There's also an OpenAPI schema generated from the rest endpoints served under `{typegate_url}/{typegraph}/rest/_schema`. | |||
A browser-based explorer for the OpenAPI schema is served under `{typegate_url}/{typegraph}/rest` as well. | |||
|
|||
You can refer to the [REST reference](/docs/reference/rest) section for more information. | |||
|
|||
{/* todo: link to the expample's redoc*/} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the comment format for better readability and completion.
- {/* todo: link to the expample's redoc*/}
+ {/* TODO: Link to the example's ReDoc. */}
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
{/* todo: link to the expample's redoc*/} | |
{/* TODO: Link to the example's ReDoc. */} |
typegraph("example", (g) => { | ||
// .. | ||
g.expose({ | ||
getUsers: .., | ||
}, pub); | ||
|
||
g.rest(` | ||
query users($name: String, $rows: Integer) { | ||
getUsers(name: $name, option: { maxRows: $rows } ) { | ||
name | ||
} | ||
} | ||
`); | ||
// .. | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
The search results indicate that the function example
is not present in the identified files, and the usage of g.rest(..)
does not align with the example provided in the documentation. The documentation example should be reviewed and corrected to ensure it accurately demonstrates the use of g.rest(..)
.
- The function
example
is not found in the codebase. - The usage of
g.rest(..)
in the identified files does not match the example provided in the documentation.
Please review and update the documentation example to ensure it correctly demonstrates the use of g.rest(..)
.
Analysis chain
Ensure that the example function example
in TypeScript is complete and correctly demonstrates the use of g.rest(..)
.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that the TypeScript example function `example` is complete and correct.
# Test: Search for the function implementation in the repository.
ast-grep --lang typescript --pattern $'function example($_) {
$$$
}'
Length of output: 71
Script:
#!/bin/bash
# Description: Search for the function `example` and verify the usage of `g.rest(..)` within it.
# Search for the function `example` in TypeScript files.
rg 'function example' --type ts
# Search for the usage of `g.rest(..)` within the function `example`.
rg 'g.rest' --type ts
Length of output: 394
Script:
#!/bin/bash
# Description: Search for the function `example` within the identified files containing `g.rest(..)` usage.
# Files identified with `g.rest(..)` usage.
files=(
"typegate/tests/rest/rest_custom_loader.ts"
"examples/typegraphs/example_rest.ts"
"examples/typegraphs/rest.ts"
"examples/typegraphs/func.ts"
)
# Search for the function `example` within these files.
for file in "${files[@]}"; do
rg 'function example' "$file"
done
Length of output: 493
Script:
#!/bin/bash
# Description: Extract and review the usage of `g.rest(..)` in the identified files.
# Files identified with `g.rest(..)` usage.
files=(
"typegate/tests/rest/rest_custom_loader.ts"
"examples/typegraphs/example_rest.ts"
"examples/typegraphs/rest.ts"
"examples/typegraphs/func.ts"
)
# Extract and display the usage of `g.rest(..)` within these files.
for file in "${files[@]}"; do
echo "File: $file"
rg 'g.rest' "$file"
echo ""
done
Length of output: 948
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Teo Stocco <zifeo@users.noreply.github.com>
Add reference page for
g.rest(..)
Migration notes
None
Summary by CodeRabbit