Skip to content

Conversation

sccalabr
Copy link

@sccalabr sccalabr commented Oct 2, 2025

Purpose

Fixes: ballerina-platform/ballerina-library#6441

Examples

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests
  • Updated the spec
  • Checked native-image compatibility
  • No commons package changes (if there are any, please update the GraphQL version in GraphQL tools and Ballerina dev tools)
  • No compiler package changes (if there are any, please update the GraphQL version in Ballerina dev tools)

@CLAassistant
Copy link

CLAassistant commented Oct 2, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ ThisaruGuruge
✅ sccalabr
❌ totesforlife
You have signed the CLA already but the status is still pending? Let us recheck it.

@ThisaruGuruge ThisaruGuruge changed the title Improve the Schema Generation with Ordering the Types #6441 Improve the Schema Generation with Ordering the Types Oct 2, 2025
@sccalabr
Copy link
Author

sccalabr commented Oct 7, 2025

Are there any updates I should make

Comment on lines +137 to +138
Assert.assertTrue(sdlSchema.contains("type Query"), "Schema should contain Query type");
Assert.assertTrue(sdlSchema.contains("hello"), "Query should have hello field");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this test is not testing the exact functionality. Shall we add an end-to-end test where we generate the schema and then compare an existing schema defined using GraphQL SDL?

I think the schema generation tests are done inside the graphql-tools repository since the GraphQL tool is the place where we generate the tests. Can you please check that too? You can publish this to your local maven repository and use the SNAPSHOT version in the graphql tools to see the failing tests (this change must fail some tests there). Please let us know if you face any issues while doing this, can help you out.

@DimuthuMadushan am I missing anything here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you’ve covered everything. With this change, the SDL schema generation test needs to be updated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to see that you have added some tests here!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff.patch
Here is a patch file showing it working in graphql tools

Copy link
Member

@ThisaruGuruge ThisaruGuruge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ThisaruGuruge
Copy link
Member

There are some compilation errors, @sccalabr can you please check?

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the Schema Generation with Ordering the Types

5 participants