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

refactor: re-write gen_gql_schema.rs #1510 #2012

Closed
wants to merge 1 commit into from

Conversation

snigdha510
Copy link

@snigdha510 snigdha510 commented May 23, 2024

Summary:
In this PR, the gen_gql_schema.rs file has been updated to address code quality and performance issues, specifically:

Enhanced Functionality:

Introduced new functions for better modularity and readability, including write_all_directives, write_all_input_types, write_property, write_directive, and others. These functions streamline the code and reduce redundancy.
Documentation:

Added comments and documentation to clarify the purpose and functionality of various functions and structures, improving code maintainability.
Improved Indentation Handling:

Implemented IndentedWriter to manage indentation consistently across the generated GraphQL schema, ensuring more readable output.
Optimized Type Handling:

Improved handling of schema types, including arrays and objects, by modularizing type writing logic into functions like write_type, write_array_validation, and write_object_validation.
Directive and Object Handling:

Refined logic for writing directives and objects, including better handling of entity mappings and directive properties, enhancing flexibility and robustness.
Enhanced Scalability:

Improved the handling of custom scalars and extended types, allowing for more scalable and extensible schema generation.
Code Cleanup:

Removed redundant code, fixed minor bugs, and applied general code cleanups to improve performance and readability.
These changes collectively improve the maintainability, readability, and extensibility of the GraphQL schema generation process.

Issue Reference(s):
Fixes #.1510

Build & Testing:

  • I ran cargo test successfully.
  • I have run ./lint.sh --mode=fix to fix all linting issues raised by ./lint.sh --mode=check.

Checklist:

  • I have added relevant unit & integration tests.
  • I have updated the documentation accordingly.
  • I have performed a self-review of my code.
  • PR follows the naming convention of <type>(<optional scope>): <title>

@github-actions github-actions bot added the type: chore Routine tasks like conversions, reorganization, and maintenance work. label May 23, 2024
@tusharmath
Copy link
Contributor

You will also need to write code to generate the service documents for each Config entity. Moving to draft until then.

@tusharmath tusharmath marked this pull request as draft May 23, 2024 07:30
Copy link

Action required: PR inactive for 2 days.
Status update or closure in 5 days.

@github-actions github-actions bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label May 25, 2024
Copy link

PR closed after 5 days of inactivity.

@github-actions github-actions bot closed this May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. type: chore Routine tasks like conversions, reorganization, and maintenance work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants