Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Rebase fork changes on top of upstream #6

Draft
wants to merge 91 commits into
base: master
Choose a base branch
from
Draft

Conversation

ValentinH
Copy link

@ValentinH ValentinH commented Sep 7, 2022

In this PR, we rebase the fork on top of the latest upstream master branch.
Some changes that were made before are not needed anymore because similar features were added on upstream:

  • "fix: create a custom scalars map with some Hasura specific types" (1cb5233) => we can use the new Scalars feature

We still have to maintain 2 differences for now:


I've tested this new version on our codebase and I see multiple reasons to not update at the moment:

  • everything is slower, fields auto-completion is not instant anymore. I guess it will be even worse on non M1 machines.
  • the new Scalars feature which I expected to replace one of our patch, isn't matching all our requirements. Especially, it doesn't properly type the parameters that can be passed to queries/mutations filters. It only typed the returned data.
  • the new way to use Apollo hooks is a heavy breaking changes that would have us touching a lot of code in our codebase. Indeed, we would not use useTypedQuery() and useTypedMutation() anymore but would have to first create the query/mutation with the typedGql function and then directly call the original useQuery() or useMutation() hooks

In this state, I'm pausing the upgrade effort for now.

elliott-home-pc and others added 30 commits February 24, 2022 14:27
work in progress on new generated functions
producer script
Updated README.md with info about new Discussions forum
…aliases

Fix multiple aliases when generating query
aexol and others added 29 commits June 30, 2022 16:25
Changed empty ZEUS_VARIABLES to empty object instead of never.
…nt-decoding

Fix Scalar Path generation for queries with inline fragments
scalars are now decoded in all ops
fixed many bugs and merged prs
In order to be able to generate two versions of the codegen:
- one for the backend generated from the "admin" permissions
- one for the frontend generated from the "org_owner" permissions

we need to replace enums by literals unions so that we can share some code between the 2 SDKs. Indeed, when using enums, Typescript complains about not having any overlap between enums even if they have the same values:
<img width="988" alt="image" src="https://user-images.githubusercontent.com/2678610/161303594-c9030409-a855-487e-94a8-dd6448a7a2c9.png"> ([code](https://www.typescriptlang.org/play?#code/KYDwDg9gTgLgBMAdgVwLYJag+gZwJapgA2wcA3gLABQccAxgIY7ACMcAvHAOSPMtcAaarV7AATB26ixg6gF9qoSLAxpV2fIRJYJlGvSatJPQ-yH7px6bKoKq1OhEQ4IJAHREIAcwAUSNLgExMBuomzsEeqBWsA6AJRAA))

While string literals unions can simply be compared:
<img width="290" alt="image" src="https://user-images.githubusercontent.com/2678610/161303751-b0d9bc5f-7b7b-46db-b926-553a9faba1ad.png">

Another benefit of using string literals unions is that they are non generated to the build output.
ValentinH added a commit that referenced this pull request Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants