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

feat: sort arguments and directives on fields, directives on inline fragments #842

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions v2/pkg/astminify/fixtures/operation10.min.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query MyQuery($skip: Boolean!, $include: Boolean!){
query {
... on ObjectB {
... on Interface {
...B
}
}
...B
}
}

fragment A on ObjectA {
__typename
age
name
}

fragment B on ObjectC @abc(a: "a", b: "b") {
aField {
...A
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query MyQuery($skip: Boolean!, $include: Boolean!){
query {
... on ObjectB {
... on Interface {
... on ObjectC {
aField {
__typename
age
name
}
}
}
}
... on ObjectC {
aField {
__typename
age
name
}
}
}
}
22 changes: 22 additions & 0 deletions v2/pkg/astminify/fixtures/operation10.normalized.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query MyQuery($skip: Boolean!, $include: Boolean!){
query {
... on ObjectB {
... on Interface {
... on ObjectC @abc(a: "a", b: "b") {
aField {
age
__typename
name
}
}
}
}
... on ObjectC @abc(b: "b", a: "a") {
aField {
__typename
name
age
}
}
}
}
2 changes: 1 addition & 1 deletion v2/pkg/astminify/fixtures/operation5.min.graphql.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ query MyQuery {
}
}
... on ObjectC {
aField(b: "b", a: "a"){
aField(a: "a", b: "b"){
...A
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ query MyQuery($a: String, $b: String){
}
}
... on ObjectC {
aField(b: $b, a: $a){
aField(a: $a, b: $b){
__typename
age
name
Expand Down
22 changes: 22 additions & 0 deletions v2/pkg/astminify/fixtures/operation6.min.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query MyQuery {
query {
... on ObjectB {
... on Interface {
...B
}
}
...B
}
}

fragment A on ObjectA {
__typename
age
name
}

fragment B on ObjectC {
aField(a: "a", b: "b"){
...A
}
}
22 changes: 22 additions & 0 deletions v2/pkg/astminify/fixtures/operation6.min.normalized.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query MyQuery($a: String, $b: String){
query {
... on ObjectB {
... on Interface {
... on ObjectC {
aField(a: $a, b: $b){
__typename
age
name
}
}
}
}
... on ObjectC {
aField(a: $a, b: $b){
__typename
age
name
}
}
}
}
22 changes: 22 additions & 0 deletions v2/pkg/astminify/fixtures/operation6.normalized.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query MyQuery($a: String, $b: String){
query {
... on ObjectB {
... on Interface {
... on ObjectC {
aField(a: $a, b: $b){
age
__typename
name
}
}
}
}
... on ObjectC {
aField(b: $b, a: $a){
__typename
name
age
}
}
}
}
22 changes: 22 additions & 0 deletions v2/pkg/astminify/fixtures/operation7.min.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query MyQuery($skip: Boolean!, $include: Boolean!){
query {
... on ObjectB {
... on Interface {
...B
}
}
...B
}
}

fragment A on ObjectA @include(if: $include) @skip(if: $skip) {
__typename
age
name
}

fragment B on ObjectC {
aField @include(if: $include) @skip(if: $skip) {
...A
}
}
22 changes: 22 additions & 0 deletions v2/pkg/astminify/fixtures/operation7.min.normalized.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query MyQuery($skip: Boolean!, $include: Boolean!){
query {
... on ObjectB {
... on Interface {
... on ObjectC {
aField @include(if: $include) @skip(if: $skip) {
__typename
age
name
}
}
}
}
... on ObjectC {
aField @include(if: $include) @skip(if: $skip) {
__typename
age
name
}
}
}
}
22 changes: 22 additions & 0 deletions v2/pkg/astminify/fixtures/operation7.normalized.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query MyQuery($skip: Boolean!, $include: Boolean!){
query {
... on ObjectB {
... on Interface {
... on ObjectC {
aField @skip(if: $skip) @include(if: $include) {
age
__typename
name
}
}
}
}
... on ObjectC {
aField @include(if: $include) @skip(if: $skip) {
__typename
name
age
}
}
}
}
22 changes: 22 additions & 0 deletions v2/pkg/astminify/fixtures/operation8.min.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query MyQuery($skip: Boolean!, $include: Boolean!){
query {
... on ObjectB {
... on Interface {
...B
}
}
...B
}
}

fragment A on ObjectA {
__typename
age
name
}

fragment B on ObjectC @include(if: $include) @skip(if: $skip) {
aField {
...A
}
}
22 changes: 22 additions & 0 deletions v2/pkg/astminify/fixtures/operation8.min.normalized.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query MyQuery {
query {
... on ObjectB {
... on Interface {
... on ObjectC {
aField {
__typename
age
name
}
}
}
}
... on ObjectC {
aField {
__typename
age
name
}
}
}
}
22 changes: 22 additions & 0 deletions v2/pkg/astminify/fixtures/operation8.normalized.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query MyQuery($skip: Boolean!, $include: Boolean!){
query {
... on ObjectB {
... on Interface {
... on ObjectC @skip(if: $skip) @include(if: $include) {
aField {
age
__typename
name
}
}
}
}
... on ObjectC @include(if: $include) @skip(if: $skip) {
aField {
__typename
name
age
}
}
}
}
23 changes: 23 additions & 0 deletions v2/pkg/astminify/fixtures/operation9.min.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
query MyQuery {
query {
...A
... on ObjectB {
aField {
...A
}
}
... on ObjectC {
aField {
...A
}
}
}
}

fragment A on ObjectA {
__typename
a: age
b: age
c: name
d: name
}
29 changes: 29 additions & 0 deletions v2/pkg/astminify/fixtures/operation9.min.normalized.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
query MyQuery {
query {
... on ObjectA {
__typename
a: age
b: age
c: name
d: name
}
... on ObjectB {
aField {
__typename
a: age
b: age
c: name
d: name
}
}
... on ObjectC {
aField {
__typename
a: age
b: age
c: name
d: name
}
}
}
}
29 changes: 29 additions & 0 deletions v2/pkg/astminify/fixtures/operation9.normalized.graphql.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
query MyQuery {
query {
... on ObjectA {
__typename
a: age
b: age
c: name
d: name
}
... on ObjectB {
aField {
b: age
a: age
__typename
d: name
c: name
}
}
... on ObjectC {
aField {
__typename
c: name
d: name
a: age
b: age
}
}
}
}
Loading
Loading