hasura / hasura/graphql-engine

Custom GraphQL Root Fields editor and output order mismatch

Open
#8,253 0 comments 4 reactions 0 assignees View on GitHub
c/console estimate/S k/enhancement
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: 2.2.0

### Environment

OSS

### What is the expected behaviour?

I expect the Custom GraphQL Root Fields editor and viewer/metadata to be set in the same order.

### What is the current behaviour?

Editor goes queries [select, select_by_pk, select_aggregate] and mutations [insert, insert_one, update, update_by_pk, delete, delete_by_pk]

Viewer and metadata strangely goes: [insert, select_aggregate, insert_one, select_by_pk, select, delete, update, delete_by_pk, update_by_pk]

### How to reproduce the issue?

1. Track a table
2. Modify it
3. Open Custom GraphQL Root Fields
4. Fill all queries and mutations with custom names
5. Notice that the order is completely different from the editor
6. Export metadata
7. Notice that the order is completely different from the editor

### Screenshots or Screencast

![image](https://user-images.githubusercontent.com/11539524/155761408-a95a6d0f-c06d-4286-b0da-4e4276638a38.png)

![image](https://user-images.githubusercontent.com/11539524/155761372-261b344d-95fc-4b9f-9a52-6315a0310035.png)

![image](https://user-images.githubusercontent.com/11539524/155761532-7c755d88-bf51-442c-991d-09720ba739a9.png)

This is especially annoying to me because when I only rename the mutations, the order is also a bit different from the editor, but nowhere near as bad:

![image](https://user-images.githubusercontent.com/11539524/155761889-ed0f495a-223a-4d28-93fe-c720cbce24fa.png)

![image](https://user-images.githubusercontent.com/11539524/155761664-d077f5a5-d92d-4ebf-a98b-061ee4e4b043.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.