Add example to use schema directives with GraphQL modules#7032
Add example to use schema directives with GraphQL modules#7032ardatan merged 1 commit intoardatan:masterfrom
Conversation
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe update adds a new section, "GraphQL modules usage", to the documentation. This section explains how to use the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant App as createApplication
participant Schema as makeExecutableSchema
participant DTrans as DirectiveTransformer
User->>App: Initiate application setup
App->>Schema: Build executable schema (schemaBuilder)
Schema->>DTrans: Apply directive transformation
DTrans-->>Schema: Return modified schema
Schema-->>App: Deliver updated schema
App-->>User: Return application with enhanced schema
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
website/src/content/schema-directives.mdx (2)
775-776: Typographical Suggestion: Add Missing CommaThe sentence starting on line 775—"If you create your application with GraphQL modules please use the
schemaBuilderparameter increateApplication()to apply the directive implementation:"—would benefit from a comma after "GraphQL modules" for better readability.Consider the following change:
-If you create your application with GraphQL modules please use the `schemaBuilder` parameter in `createApplication()` to apply the directive implementation: +If you create your application with GraphQL modules, please use the `schemaBuilder` parameter in `createApplication()` to apply the directive implementation:🧰 Tools
🪛 LanguageTool
[typographical] ~775-~775: It seems that a comma is missing.
Context: ...te your application with GraphQL modules please use theschemaBuilderparameter in `c...(IF_PLEASE_COMMA)
778-797: Review of the Example Code SnippetThe provided code snippet effectively demonstrates the use of the
schemaBuilderparameter to construct and transform the schema. The in-line comments ("Build the schema from modules" and "Apply the directive transformer, i.e. rename directive") make the process clear.As an optional improvement, you might consider using the ES6 shorthand for the resolvers property. For example, replacing:
- resolvers: resolvers + resolvers,This change is a minor stylistic suggestion that can make the example even more succinct.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
website/src/content/schema-directives.mdx(1 hunks)
🧰 Additional context used
🪛 LanguageTool
website/src/content/schema-directives.mdx
[typographical] ~775-~775: It seems that a comma is missing.
Context: ...te your application with GraphQL modules please use the schemaBuilder parameter in `c...
(IF_PLEASE_COMMA)
⏰ Context from checks skipped due to timeout of 90000ms (13)
- GitHub Check: Unit Test on Node 18 (windows-latest) and GraphQL v16
- GitHub Check: Unit Test on Node 23 (ubuntu-latest) and GraphQL v16
- GitHub Check: Unit Test on Node 23 (ubuntu-latest) and GraphQL v15
- GitHub Check: Unit Test on Node 22 (ubuntu-latest) and GraphQL v16
- GitHub Check: Unit Test on Node 22 (ubuntu-latest) and GraphQL v15
- GitHub Check: Unit Test on Node 20 (ubuntu-latest) and GraphQL v16
- GitHub Check: Unit Test on Node 20 (ubuntu-latest) and GraphQL v15
- GitHub Check: Unit Test on Node 18 (ubuntu-latest) and GraphQL v16
- GitHub Check: Unit Test on Node 18 (ubuntu-latest) and GraphQL v15
- GitHub Check: Unit Test on Bun (ubuntu-latest) and GraphQL v16
- GitHub Check: Full Check on GraphQL v16
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
website/src/content/schema-directives.mdx (1)
773-774: New Section "GraphQL modules usage" IntroducedThis new section clearly explains how to leverage the
schemaBuilderparameter withincreateApplication()for applying directive transformers. The inclusion of a practical code snippet greatly enhances the documentation for users implementing GraphQL modules.
|
Thanks @acharkov ! |
Co-authored-by: Alexander <acharkov@csgo.com>
Description
Clarify usage GraphQL Modules with Schema Directives with relevant example.
Type of change
Only documentation updated, no code changes.
How Has This Been Tested?
Updated documentation. Builded docs and checked that provided change is shown on localhost web site.
Checklist:
CONTRIBUTING doc and the
style guidelines of this project