From 6023a21279c45d083843e63c7b07a3012c947127 Mon Sep 17 00:00:00 2001 From: Andrew Still Date: Thu, 15 Jan 2026 13:32:00 -0500 Subject: [PATCH] correectly query for parent on service, not for system. Remove unused pagination variables as parent is not paginated --- service.go | 4 ++-- service_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/service.go b/service.go index d608df70..d3f1d114 100644 --- a/service.go +++ b/service.go @@ -169,7 +169,7 @@ func (service *Service) GetSystem(client *Client, variables *PayloadVariables) ( var q struct { Account struct { Service struct { - System System `graphql:"system"` + System System `graphql:"parent"` } `graphql:"service(id: $service)"` } } @@ -177,7 +177,7 @@ func (service *Service) GetSystem(client *Client, variables *PayloadVariables) ( return nil, fmt.Errorf("unable to get system, invalid Service id: '%s'", service.Id) } if variables == nil { - variables = client.InitialPageVariablesPointer() + variables = &PayloadVariables{} } (*variables)["service"] = service.Id if err := client.Query(&q, *variables, WithName("ServiceSystemGet")); err != nil { diff --git a/service_test.go b/service_test.go index f38286d5..efc55bf3 100644 --- a/service_test.go +++ b/service_test.go @@ -45,9 +45,9 @@ func TestServiceTags(t *testing.T) { func TestServiceSystem(t *testing.T) { // Arrange request := autopilot.NewTestRequest( - `query ServiceSystemGet($after:String!$first:Int!$service:ID!){account{service(id: $service){system{id,aliases,description,htmlUrl,managedAliases,name,note,owner{... on Team{teamAlias:alias,id}},parent{id,aliases,description,htmlUrl,managedAliases,name,note,owner{... on Team{teamAlias:alias,id}}}}}}}`, - `{ {{ template "first_page_variables" }}, "service": "Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS85NjQ4" }`, - `{ "data": { "account": { "service": { "system": {{ template "system1_response" }} } } } }`, + `query ServiceSystemGet($service:ID!){account{service(id: $service){parent{id,aliases,description,htmlUrl,managedAliases,name,note,owner{... on Team{teamAlias:alias,id}},parent{id,aliases,description,htmlUrl,managedAliases,name,note,owner{... on Team{teamAlias:alias,id}}}}}}}`, + `{ "service": "Z2lkOi8vb3BzbGV2ZWwvU2VydmljZS85NjQ4" }`, + `{ "data": { "account": { "service": { "parent": {{ template "system1_response" }} } } } }`, ) client := BestTestClient(t, "service/system", request) // Act