feat: Add Relay-compatible GraphQL endpoint#927
feat: Add Relay-compatible GraphQL endpoint#927google-labs-jules[bot] wants to merge 10 commits intomasterfrom
Conversation
This commit introduces a new Relay-compatible GraphQL endpoint to the server. The new endpoint is available at `/graphql` and currently exposes a `contacts` query. This query follows Relay conventions, providing a `node` interface for global object identification and a connection-based model for lists. Key features of this implementation include: - Use of `graphql-relay` to ensure compliance with Relay specifications. - Integration of `dataloader` to prevent the N+1 problem by batching and caching data requests. - A Test-Driven Development (TDD) approach, with integration tests that verify the endpoint's functionality, including fetching lists and single nodes.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. |
This commit introduces a new Relay-compatible GraphQL endpoint to the server. The new endpoint is available at `/graphql` and currently exposes a `contacts` query. This query follows Relay conventions, providing a `node` interface for global object identification and a connection-based model for lists. Key features of this implementation include: - Use of `graphql-relay` to ensure compliance with Relay specifications. - Integration of `dataloader` to prevent the N+1 problem by batching and caching data requests. - A Test-Driven Development (TDD) approach, with integration tests that verify the endpoint's functionality, including fetching lists and single nodes. - A custom `URL` scalar type for the `image` field in the `Contact` type.
This commit introduces a new Relay-compatible GraphQL endpoint to the server. The new endpoint is available at `/graphql` and currently exposes a `contacts` query. This query follows Relay conventions, providing a `node` interface for global object identification and a connection-based model for lists. Key features of this implementation include: - Use of `graphql-relay` to ensure compliance with Relay specifications. - Integration of `dataloader` to prevent the N+1 problem by batching and caching data requests. - A Test-Driven Development (TDD) approach, with integration tests that verify the endpoint's functionality, including fetching lists and single nodes. - A custom `URL` scalar type for the `image` field in the `Contact` type.
This commit introduces a new Relay-compatible GraphQL endpoint to the server. The new endpoint is available at `/graphql` and currently exposes a `contacts` query. This query follows Relay conventions, providing a `node` interface for global object identification and a connection-based model for lists. Key features of this implementation include: - Use of `graphql-relay` to ensure compliance with Relay specifications. - Integration of `dataloader` to prevent the N+1 problem by batching and caching data requests. - A Test-Driven Development (TDD) approach, with integration tests that verify the endpoint's functionality, including fetching lists and single nodes. - A custom `URL` scalar type for the `image` field in the `Contact` type.
|
Didn't realize that would automatically request a review from all three of us, sorry! I've been playing with https://relay.dev at work, and I'm really appreciating the "declarative data fetching" nature of relay. I'd like to try adding a graphql endpoint to CCC, even if we never use it in the app. This PR just adds an endpoint for contacts, but it's a start! |
This commit introduces a new Relay-compatible GraphQL endpoint to the server. The new endpoint is available at `/graphql` and currently exposes a `contacts` query. This query follows Relay conventions, providing a `node` interface for global object identification and a connection-based model for lists. Key features of this implementation include: - Use of `graphql-relay` to ensure compliance with Relay specifications. - Integration of `dataloader` to prevent the N+1 problem by batching and caching data requests. - A Test-Driven Development (TDD) approach, with integration tests that verify the endpoint's functionality, including fetching lists and single nodes. - A custom `URL` scalar type for the `image` field in the `Contact` type. - Use of Zod for type-safe resolution in the `nodeDefinitions`.
This commit introduces a new Relay-compatible GraphQL endpoint to the server. The new endpoint is available at `/graphql` and currently exposes a `contacts` query and a `dictionary` query. These queries follow Relay conventions, providing a `node` interface for global object identification and a connection-based model for lists. Key features of this implementation include: - Use of `graphql-relay` to ensure compliance with Relay specifications. - Integration of `dataloader` to prevent the N+1 problem by batching and caching data requests. - A Test-Driven Development (TDD) approach, with integration tests that verify the endpoint's functionality, including fetching lists and single nodes. - A custom `URL` scalar type for the `image` field in the `Contact` type. - Use of Zod for type-safe resolution in the `nodeDefinitions`. - A refactored and scalable type resolution system for the `node` interface.
|
|
||
| type KnownGraphQLTypeNames = 'Contact' | 'DictionaryDefinition' | ||
|
|
||
| const ContactSchema = z.object({ |
There was a problem hiding this comment.
Think we extracted other schemas to their own files but should be okay
There was a problem hiding this comment.
I figure we can figure out the desired file structure for these later, but … eh, lemme split them out now.
There was a problem hiding this comment.
It's fine, we're making gradual changes and can polish later
This commit introduces a new Relay-compatible GraphQL endpoint to the server. The new endpoint is available at `/graphql` and currently exposes a `contacts` query and a `dictionary` query. These queries follow Relay conventions, providing a `node` interface for global object identification and a connection-based model for lists. Key features of this implementation include: - A modular and scalable architecture with GraphQL types, utilities, and schema assembly separated into their own files. - Use of `graphql-relay` to ensure compliance with Relay specifications. - Integration of `dataloader` to prevent the N+1 problem by batching and caching data requests. - A Test-Driven Development (TDD) approach, with integration tests that verify the endpoint's functionality, including fetching lists and single nodes. - A custom `URL` scalar type for the `image` field in the `Contact` type. - Use of Zod for type-safe resolution in the `nodeDefinitions`.
This commit introduces a new Relay-compatible GraphQL endpoint to the server. The new endpoint is available at `/graphql` and currently exposes a `contacts` query and a `dictionary` query. These queries follow Relay conventions, providing a `node` interface for global object identification and a connection-based model for lists. Key features of this implementation include: - A modular and scalable architecture with GraphQL types, utilities, and schema assembly separated into their own files. - Use of `graphql-relay` to ensure compliance with Relay specifications. - Integration of `dataloader` to prevent the N+1 problem by batching and caching data requests. - A Test-Driven Development (TDD) approach, with integration tests that verify the endpoint's functionality, including fetching lists and single nodes. - A custom `URL` scalar type for the `image` field in the `Contact` type. - Use of Zod for type-safe resolution in the `nodeDefinitions`.
This commit introduces a new Relay-compatible GraphQL endpoint to the server.
The new endpoint is available at
/graphqland currently exposes acontactsquery. This query follows Relay conventions, providing anodeinterface for global object identification and a connection-based model for lists.Key features of this implementation include:
graphql-relayto ensure compliance with Relay specifications.dataloaderto prevent the N+1 problem by batching and caching data requests.PR created automatically by Jules for task 14209361552567519475