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

WIP: add generation for serverside frameworks #2056

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kleberbaum
Copy link

Currently, the fetch mode is always set to 'CORS' in the generated code.
In Cloudflare Workers and many other server-side environments, CORS is
not required and sometimes not even supported. This change adds a
conditional generation of the fetch mode based on the framework
e.g. Hono, Pylon, etc.
Variables are sorted alphabetically using lexicographicSortSchema,
which causes TypeScript type conflicts when optional parameters follow
required ones. This change conditionally sorts the schema based on the
framework (e.g. React, SolidJS, Hono, Pylon) to prevent these type
conflicts.
Added mutation-query-types.ts to generate MutationTypes and QueryTypes.
This module processes the interpreted GraphQL schema to create type
declarations for mutations and queries, enhancing type safety.
Added mutation-query-param-names.ts to generate MutationParamNames and
QueryParamNames. This module creates runtime objects that store argument
names for each mutation and query field which makes possible to convert
between params and args.
Added convert-params-to-args.ts to provide helper functions for
converting parameter tuples into argument objects. This module includes
functions for dynamically mapping parameters to their respective
argument names, enhancing runtime parameter handling.
@kleberbaum
Copy link
Author

Hi @vicary, sorry for the radio silence. I am currently on vacation in Japan until 01.03.2025 I am still interested in introducing these changes and will try to be more responsive during the next week.

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.

1 participant