Closed tackley closed 4 months ago
[puLL-Merge] - brave/ads-ui@1173
Here is my review of the pull request:
This PR migrates the queries and mutations used throughout the frontend codebase to be generated from a central location using GraphQL Codegen. This removes the need to manually update types and query/mutation hooks in multiple locations whenever the GraphQL schema changes.
This change does not introduce any new security vulnerabilities. It simply changes how the GraphQL types and operations are generated and imported in the codebase.
The generated files under src/graphql-client/
should not be manually edited, as noted by the linguist-generated
attribute. This properly communicates that developers should not make changes directly in those files.
The biggest risk would be if the central codegen.ts
config that controls the generation was misconfigured in a way that caused invalid or incomplete types/operations to be generated. However, this risk is low and would likely be caught quickly in development.
As we use on other internal projects, use the client-preset for codegen. This means we can more easily:
useSuspenseQuery
I've tried to be mechanical about the changes here, limiting changes to just what was needed.