-
Notifications
You must be signed in to change notification settings - Fork 138
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
feat: codegen supergraph #2544
feat: codegen supergraph #2544
Conversation
"@graphql-codegen/client-preset": "^3.0.1", | ||
"@graphql-codegen/typescript": "^3.0.0", | ||
"@graphql-codegen/typescript-operations": "^3.0.0", | ||
"@graphql-codegen/cli": "^5.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was upgrading all the codegen tools required to get it to work with the super graph?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was originally getting alot of errors when running codegen, so the first task did was update all the packages. but the main package to make federation work is @graphql-codegen/typescript-resolvers
. So not sure if all the others need to be updated, but it seems to work
6bff5e3
to
c7ef323
Compare
8f0d1f6
to
f190e22
Compare
query supportedCountries { | ||
globals { | ||
supportedCountries { | ||
id | ||
supportedAuthChannels | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was duplicated in the codebase
walletId: $walletId | ||
address: $address | ||
amount: $amount | ||
targetConfirmations: $targetConfirmations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
targetConfirmations is a depreciated field that is not used in the mobile app
@@ -1,6 +1,6 @@ | |||
overwrite: true | |||
schema: "https://raw.githubusercontent.com/GaloyMoney/galoy/main/src/graphql/public/schema.graphql" | |||
# schema: "../galoy/src/graphql/public/schema.graphql" | |||
schema: "https://api.staging.galoy.io/graphql" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will always have to target a live environment from now on? couldn't we write the graphql somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the introspection endpoint. i am not sure how to easily get the raw supergraph graphql otherwise because its in the private circles repo (i.e the https://raw.githubusercontent.com/GaloyMoney/blink-circles/main/dev/apollo-federation/supergraph.graphql?token=TOKEN_HERE url probably won't work because it has a ?token
secret appended to the end).
@krtk6160 do you have any ideas on how to write the supergraph.graphql
somewhere public during the CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bodymindarts Any thoughts on where we can keep the generated supergraph?
Should we sync it to the mobile repo like we sync the proto files?
This PR adds the codegen config for the supergraph so the mobile app can query
my welcome profile
.The query will look like this:
The hook should look something like this:
TODO
skipDocumentsValidation: true
should be false but getERROR Fragment cannot be spread here as objects of type "Account" can never be of type "ConsumerAccount".
graphql-codegen
apollo federation docs https://the-guild.dev/graphql/codegen/docs/integrations/federationgraphql-codegen
apollo federation GraphQL Code Generator v5 Roadmap dotansimha/graphql-code-generator#8296