ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.

Home Page:https://chillicream.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Persisted queries in relay format should be written in deterministic order

DanielZuerrer opened this issue · comments

Product

Strawberry Shake

Is your feature request related to a problem?

When writing persisted queries in relay format, the queries are written in non-deterministic order. This leads to changes in the git repository even if the queries remain identical. To fix this, the queries should be written in a deterministic order to file.

The solution you'd like

I already have a proposal for a simple fix: DanielZuerrer@6c2fd69. I'd be happy to create a pull request if you think the change is sensible.

Sounds like a sensible change to me.

Personally, I'd probably just put the file in a .gitignore and generate the persisted operations during CI. That way you're certain they are up-to-date. Having them checked in doesn't really provide a benefit as they are generated on every build anyways and changes to the operations are already surfaced in code review through the .graphql files.

I agree that it would probably be the best to not have the persisted queries in version control at all. With our CI setup where solutions are built in docker and pipelines are not setup to extract files from docker images it would require some changing of the pipelines themselves. So I think there is still some value to have the queries be in deterministic order, even if it's probably not the best practice.