-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: add filtering support for twingate resources datasource (#443)
* added new attributes for resources datasource * added optional name attributes for resources datasource * added feature branch * fix test * remove feature branch * enable tests * remove feature branch * refactore * updated docs * update resources datasource: allow to list all resources * fix docs --------- Co-authored-by: Bob Lee <[email protected]>
- Loading branch information
1 parent
0bffd0b
commit cad0a46
Showing
11 changed files
with
351 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
package query | ||
|
||
type ReadResourcesByName struct { | ||
Resources `graphql:"resources(filter: {name: {eq: $name}}, after: $resourcesEndCursor, first: $pageLimit)"` | ||
Resources `graphql:"resources(filter: $filter, after: $resourcesEndCursor, first: $pageLimit)"` | ||
} | ||
|
||
func (q ReadResourcesByName) IsEmpty() bool { | ||
return len(q.Edges) == 0 | ||
} | ||
|
||
type ResourceFilterInput struct { | ||
Name *StringFilterOperationInput `json:"name"` | ||
} | ||
|
||
func NewResourceFilterInput(name, filter string) *ResourceFilterInput { | ||
return &ResourceFilterInput{ | ||
Name: NewStringFilterOperationInput(name, filter), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.