Skip to content
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

fix: correct graphql.config.js #10582

Merged
merged 1 commit into from
Dec 19, 2024
Merged

fix: correct graphql.config.js #10582

merged 1 commit into from
Dec 19, 2024

Conversation

mattkrick
Copy link
Member

@mattkrick mattkrick commented Dec 11, 2024

Description

This uses the latest format for graphql.config.js, so now extensions play nicely, if you want to use them

Summary by CodeRabbit

  • New Features

    • Added recommendations for GraphQL-related extensions to enhance the development environment.
  • Configuration Updates

    • Updated project configuration for GraphQL, including changes to project name and schema properties.
    • Introduced a new property to exclude specific client files from the configuration.

Copy link
Contributor

coderabbitai bot commented Dec 11, 2024

Walkthrough

The changes involve updates to the .vscode/extensions.json file and the graphql.config.js file. In the .vscode/extensions.json, two new GraphQL-related extensions have been added to the recommendations. The graphql.config.js file has undergone significant modifications, including the renaming of a project, updates to schema and document properties, and the introduction of an exclusion property for client files.

Changes

File Change Summary
.vscode/extensions.json Added extensions: "GraphQL.vscode-graphql" and "GraphQL.vscode-graphql-syntax"
graphql.config.js Updated project name from Parabol to server, changed schemaPath to schema, replaced includes with documents, and added exclude property for client files.

Possibly related PRs

  • fix: nest-graphql-endpoint support graphql v16 #10066: This PR addresses compatibility with GraphQL version 16, which is relevant to the changes made in the main PR that involve adding GraphQL-related extensions, indicating a focus on enhancing the GraphQL development environment.

Suggested labels

size/xs

Poem

🐰 In the land of code where rabbits play,
New GraphQL tools have come our way!
With schemas and documents, all set to go,
Our coding burrows will surely glow!
Hop along, dear friends, let’s code and cheer,
For the world of GraphQL is now more clear! 🌟


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
.vscode/extensions.json (1)

9-11: Consider maintaining alphabetical order

The extensions list was previously alphabetically ordered. Consider reordering the new extensions:

-    "yzhang.markdown-all-in-one",
-    "GraphQL.vscode-graphql",
-    "GraphQL.vscode-graphql-syntax"
+    "GraphQL.vscode-graphql",
+    "GraphQL.vscode-graphql-syntax",
+    "yzhang.markdown-all-in-one"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 9572815 and 471f0cf.

📒 Files selected for processing (2)
  • .vscode/extensions.json (1 hunks)
  • graphql.config.js (1 hunks)
🔇 Additional comments (4)
.vscode/extensions.json (1)

10-11: LGTM! Good addition of GraphQL extensions

The addition of official GraphQL extensions will improve the development experience with better GraphQL support.

graphql.config.js (3)

3-5: LGTM! Updated to modern GraphQL config format

The configuration has been correctly updated to use the modern format with schema and documents properties.


6-8: Verify the necessity of the exclude pattern

The comment indicates uncertainty about the exclude pattern. Let's verify if this is actually needed.

✅ Verification successful

Based on the output, I can now generate the final response since we have clear evidence about the usage of Relay fragments in the client directory.

The exclude pattern is necessary - keep it

The exclude pattern ./packages/client/**/* is indeed necessary as the codebase shows extensive usage of Relay fragments throughout the client directory. The search results revealed:

  • Over 200 Relay fragment definitions using graphql template literals
  • Fragments are used for various features like mutations, subscriptions, and component data requirements
  • These fragments are handled by the Relay compiler extension, not the base GraphQL config

The comment accurately explains the reason for the exclude pattern - it prevents conflicts between the base GraphQL configuration and Relay's specialized handling of client-side fragments.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for relay fragments in client directory that might conflict
echo "Checking for GraphQL/Relay fragments in client directory..."
rg -t js -t ts "graphql\`|fragment" ./packages/client

# Check if the relay extension is configured
echo "Checking for relay extension configuration..."
find . -maxdepth 3 -type f -name "relay.config.js"

Length of output: 66844


3-3: Verify impact of project rename

The project has been renamed from "Parabol" to "server". Let's verify there are no references to the old name.

✅ Verification successful

Based on the search results, I can see that "Parabol" appears extensively throughout the codebase, but primarily in imports, comments, documentation, and configuration files. The change from "Parabol" to "server" in graphql.config.js appears to be an isolated configuration change that only affects the GraphQL project name and does not impact the functionality or references in the actual codebase.

Project rename is safe

The change from "Parabol" to "server" in graphql.config.js is a local configuration change that only affects the GraphQL project name. This change aligns with the package name "parabol-server" and does not require changes elsewhere in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for references to the old GraphQL project name
echo "Checking for references to 'Parabol' GraphQL project..."
rg -l "graphql.*Parabol" --type=js --type=json

Length of output: 175


Script:

#!/bin/bash
# Let's try a broader search for "Parabol" in configuration files and source code
echo "Searching for 'Parabol' in various file types..."
rg -i "parabol" --type=js --type=json --type=yaml --type=ts

# Also check the graphql config file content
echo -e "\nChecking graphql.config.js content:"
cat graphql.config.js

Length of output: 68348

@mattkrick mattkrick merged commit af1b034 into master Dec 19, 2024
8 checks passed
@mattkrick mattkrick deleted the fix/graphql-typeahead branch December 19, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant