Skip to content

Commit

Permalink
Merge pull request #141 from newrelic/fix/entity-search-by-tags
Browse files Browse the repository at this point in the history
fix(entities): tags filter needs to use type TagValue in graphql query
  • Loading branch information
sanderblue authored Feb 20, 2020
2 parents c5c220c + 2fd1f08 commit 8a7a8ea
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/entities/entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type SearchEntitiesParams struct {
InfrastructureIntegrationType string `json:"infrastructureIntegrationType,omitempty"`
Name string `json:"name,omitempty"`
Reporting *bool `json:"reporting,omitempty"`
Tags []Tag `json:"tags,omitempty"`
Tags *TagValue `json:"tags,omitempty"`
Type EntityType `json:"type,omitempty"`
}

Expand Down
20 changes: 20 additions & 0 deletions pkg/entities/entities_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,31 @@ func TestIntegrationSearchEntities(t *testing.T) {
params := SearchEntitiesParams{
Name: "Dummy App",
}

actual, err := client.SearchEntities(params)

require.NoError(t, err)
require.Greater(t, len(actual), 0)
}

func TestIntegrationSearchEntitiesByTags(t *testing.T) {
t.Parallel()

client := newIntegrationTestClient(t)

params := SearchEntitiesParams{
Tags: &TagValue{
Key: "language",
Value: "nodejs",
},
}

actual, err := client.SearchEntities(params)

require.NoError(t, err)
require.NotNil(t, actual)
}

func TestIntegrationGetEntities(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit 8a7a8ea

Please sign in to comment.