Skip to content

Switch GraphQL imports and add code generation #50

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

Merged
merged 2 commits into from
May 20, 2025

Conversation

danisal
Copy link
Contributor

@danisal danisal commented May 16, 2025


Description

This pull request includes the following changes:

  • Replaced all default GraphQL imports with imports from the discovery module for better maintainability and centralized handling.
  • Introduced code generation using GraphQL Codegen to generate TypeScript types from schemas and queries, enhancing type safety and workflow efficiency.
  • Migrated GraphQL queries into separate files for improved organization.
  • Updated the codegen configuration to fetch the shop API schema using environment variables and generate client code accordingly.
  • Enhanced customer creation error logging by stringifying the error object for more detailed debugging information.

danisal added 2 commits May 16, 2025 15:48
- Moves GraphQL queries to separate files and introduces code generation using GraphQL Codegen.

- This change improves code maintainability, type safety, and overall development workflow by generating TypeScript types from GraphQL schemas and queries.

- The codegen configuration fetches the shop API schema using environment variables for authentication and generates client code.

- Additionally, the customer creation error logging is improved by stringifying the error object, providing more detailed information for debugging.
- Updated all GraphQL imports to use the discovery module instead of the default generated module.
- This centralizes the GraphQL operation handling and improves maintainability.
- Added a new `generated/discovery/gql.ts` file to support type-safe queries.
@danisal danisal requested review from didrikhegna and vydimitrov May 16, 2025 15:01
Copy link

vercel bot commented May 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nextjs-furnitut ✅ Ready (Inspect) Visit Preview May 16, 2025 3:01pm

@danisal danisal merged commit b0cfbc8 into fix/cart May 20, 2025
1 check passed
@danisal danisal deleted the feat/shop-api-codegen branch May 20, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants