Skip to content

Commit

Permalink
[feature] Enable Quest Tasks Relay Connection (#693)
Browse files Browse the repository at this point in the history
* convert quests{tasks{}} to relay connection to enable filtering

* fix(UI): Add UI changes and rebuild

---------

Co-authored-by: Squidli <[email protected]>
  • Loading branch information
KCarretto and cmp5987 authored Mar 6, 2024
1 parent a5f431e commit d033249
Show file tree
Hide file tree
Showing 29 changed files with 445 additions and 423 deletions.
76 changes: 75 additions & 1 deletion tavern/internal/ent/gql_collection.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 19 additions & 10 deletions tavern/internal/ent/gql_edge.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tavern/internal/ent/schema/quest.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (Quest) Edges() []ent.Edge {
edge.To("tasks", Task.Type).
Annotations(
entgql.Skip(entgql.SkipMutationCreateInput),
entgql.RelayConnection(),
).
Comment("Tasks tracking the status and output of individual tome execution on targets"),
edge.To("creator", User.Type).
Expand Down
119 changes: 87 additions & 32 deletions tavern/internal/graphql/generated/ent.generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 26 additions & 4 deletions tavern/internal/graphql/generated/root_.generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions tavern/internal/graphql/quest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,24 @@ func newCreateQuestTest(gqlClient *client.Client, beaconIDs []int, input ent.Cre
mut := `mutation newCreateQuestTest($beaconIDs: [ID!]!, $input: CreateQuestInput!) { createQuest(beaconIDs:$beaconIDs, input:$input) {
id
tasks {
id
edges {
node {
id
}
}
}
} }`

// Make our request to the GraphQL API
var resp struct {
CreateQuest struct {
ID string
Tasks []struct {
ID string
Tasks struct {
Edges []struct {
Node struct {
ID string
} `json:"node"`
} `json:"edges"`
} `json:"tasks"`
}
}
Expand Down
Loading

0 comments on commit d033249

Please sign in to comment.