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] 1st PoC for typed gql queries design doc #2367

Closed
wants to merge 1 commit into from

Conversation

fishi0x01
Copy link
Contributor

@fishi0x01 fishi0x01 commented Apr 28, 2022

⚠️ In Progress

This is a very simple PoC to leverage https://github.com/profusion/sgqlc as a gql client and code generator.

Background

Design Doc

Based on idea https://gitlab.cee.redhat.com/service/app-interface/-/blob/master/docs/app-sre/design-docs/gql-client-for-go-integrations.md

GraphQL data is currently used in un-typed nested dictionaries. Adding type safety will increase maintainability of the code base. Non-compliant schema changes (some integrations are using a schema that you might not be aware of) are more likely to raise errors during development. The idea would be to gradually migrate to typed queries over time, i.e., use the new typed_gql_query.py whenever a good occasion occurs. query.py and typed_gql_query.py can co-exist.

All .py files in schema directory are generated. Only .gql query files are manually written to clearly define the query

Open Issue

No static type checking currently supported. While theoretically doable, it would require an upstream contribution.

profusion/sgqlc#129 (comment)

@fishi0x01 fishi0x01 force-pushed the typed-gql-queries branch 3 times, most recently from f4a2320 to 365e80a Compare April 29, 2022 10:45
@fishi0x01 fishi0x01 changed the title [WIP] PoC for typed gql queries design doc [WIP] 1st PoC for typed gql queries design doc May 10, 2022
@fishi0x01
Copy link
Contributor Author

We ruled out sgqlc as an option as described in design doc. Closing this PoC now.

@fishi0x01 fishi0x01 closed this Jun 16, 2022
@fishi0x01 fishi0x01 deleted the typed-gql-queries branch November 25, 2022 12:46
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