Skip to content

Commit

Permalink
Fix(GraphQL): Change variable name generation from Type<Num> to Type_…
Browse files Browse the repository at this point in the history
…<Num> (#7556)

* Change variable name generation from Type<Num> to Type_<Num>

* Add yaml test
  • Loading branch information
vmrajas authored Mar 12, 2021
1 parent 1a0a501 commit 74ff7cd
Show file tree
Hide file tree
Showing 15 changed files with 1,357 additions and 1,212 deletions.
990 changes: 563 additions & 427 deletions graphql/resolve/add_mutation_test.yaml

Large diffs are not rendered by default.

364 changes: 182 additions & 182 deletions graphql/resolve/auth_add_test.yaml

Large diffs are not rendered by default.

210 changes: 105 additions & 105 deletions graphql/resolve/auth_delete_test.yaml

Large diffs are not rendered by default.

544 changes: 272 additions & 272 deletions graphql/resolve/auth_query_test.yaml

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions graphql/resolve/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,20 +430,20 @@ func mutationQueryRewriting(t *testing.T, sch string, authMeta *testutil.AuthMet
}
}`,
rewriter: NewAddRewriter,
assigned: map[string]string{"Ticket2": "0x4"},
idExistence: map[string]string{"Column1": "0x1"},
assigned: map[string]string{"Ticket_2": "0x4"},
idExistence: map[string]string{"Column_1": "0x1"},
dgQuery: `query {
AddTicketPayload.ticket(func: uid(TicketRoot)) {
Ticket.id : uid
Ticket.title : Ticket.title
Ticket.onColumn : Ticket.onColumn @filter(uid(Column1)) {
Ticket.onColumn : Ticket.onColumn @filter(uid(Column_1)) {
Column.colID : uid
Column.name : Column.name
}
}
TicketRoot as var(func: uid(Ticket4)) @filter(uid(TicketAuth5))
Ticket4 as var(func: uid(0x4))
TicketAuth5 as var(func: uid(Ticket4)) @cascade {
TicketRoot as var(func: uid(Ticket_4)) @filter(uid(Ticket_Auth5))
Ticket_4 as var(func: uid(0x4))
Ticket_Auth5 as var(func: uid(Ticket_4)) @cascade {
Ticket.onColumn : Ticket.onColumn {
Column.inProject : Column.inProject {
Project.roles : Project.roles @filter(eq(Role.permission, "VIEW")) {
Expand All @@ -453,10 +453,10 @@ func mutationQueryRewriting(t *testing.T, sch string, authMeta *testutil.AuthMet
}
}
var(func: uid(TicketRoot)) {
Column2 as Ticket.onColumn
Column_2 as Ticket.onColumn
}
Column1 as var(func: uid(Column2)) @filter(uid(ColumnAuth3))
ColumnAuth3 as var(func: uid(Column2)) @cascade {
Column_1 as var(func: uid(Column_2)) @filter(uid(Column_Auth3))
Column_Auth3 as var(func: uid(Column_2)) @cascade {
Column.inProject : Column.inProject {
Project.roles : Project.roles @filter(eq(Role.permission, "VIEW")) {
Role.assignedTo : Role.assignedTo @filter(eq(User.username, "user1"))
Expand Down Expand Up @@ -486,14 +486,14 @@ func mutationQueryRewriting(t *testing.T, sch string, authMeta *testutil.AuthMet
UpdateTicketPayload.ticket(func: uid(TicketRoot)) {
Ticket.id : uid
Ticket.title : Ticket.title
Ticket.onColumn : Ticket.onColumn @filter(uid(Column1)) {
Ticket.onColumn : Ticket.onColumn @filter(uid(Column_1)) {
Column.colID : uid
Column.name : Column.name
}
}
TicketRoot as var(func: uid(Ticket4)) @filter(uid(TicketAuth5))
Ticket4 as var(func: uid(0x4))
TicketAuth5 as var(func: uid(Ticket4)) @cascade {
TicketRoot as var(func: uid(Ticket_4)) @filter(uid(Ticket_Auth5))
Ticket_4 as var(func: uid(0x4))
Ticket_Auth5 as var(func: uid(Ticket_4)) @cascade {
Ticket.onColumn : Ticket.onColumn {
Column.inProject : Column.inProject {
Project.roles : Project.roles @filter(eq(Role.permission, "VIEW")) {
Expand All @@ -503,10 +503,10 @@ func mutationQueryRewriting(t *testing.T, sch string, authMeta *testutil.AuthMet
}
}
var(func: uid(TicketRoot)) {
Column2 as Ticket.onColumn
Column_2 as Ticket.onColumn
}
Column1 as var(func: uid(Column2)) @filter(uid(ColumnAuth3))
ColumnAuth3 as var(func: uid(Column2)) @cascade {
Column_1 as var(func: uid(Column_2)) @filter(uid(Column_Auth3))
Column_Auth3 as var(func: uid(Column_2)) @cascade {
Column.inProject : Column.inProject {
Project.roles : Project.roles @filter(eq(Role.permission, "VIEW")) {
Role.assignedTo : Role.assignedTo @filter(eq(User.username, "user1"))
Expand Down
Loading

0 comments on commit 74ff7cd

Please sign in to comment.