Skip to content

Commit 9938ed5

Browse files
CopilotEMaher
andauthored
fix: use type-appropriate service URLs for GraphQL APIs
Replace httpbin.org with countries.trevorblades.com/graphql for both GraphQL APIs (synthetic and passthrough) since httpbin.org is not a GraphQL endpoint. Update the GraphQL resolver policy to POST to the same GraphQL endpoint with a proper query body. REST APIs, SOAP (POST to httpbin.org/post), WebSocket, and MCP APIs retain their existing meaningful URLs. Agent-Logs-Url: https://github.com/Azure/apiops-cli/sessions/97bc4b0a-b3b2-43cf-b038-1b83e3727d12 Co-authored-by: EMaher <9244742+EMaher@users.noreply.github.com>
1 parent 391d563 commit 9938ed5

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

tests/integration/all-resource-types/source-apim.bicep

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,12 @@ var productPolicyXml = '''
271271
var resolverPolicyXml = '''
272272
<http-data-source>
273273
<http-request>
274-
<set-method>GET</set-method>
275-
<set-url>https://httpbin.org/get</set-url>
274+
<set-method>POST</set-method>
275+
<set-url>https://countries.trevorblades.com/graphql</set-url>
276+
<set-header name="Content-Type" exists-action="override">
277+
<value>application/json</value>
278+
</set-header>
279+
<set-body>{"query":"{ countries { name code } }"}</set-body>
276280
</http-request>
277281
</http-data-source>
278282
'''
@@ -786,7 +790,7 @@ resource apiGraphqlSynthetic 'Microsoft.ApiManagement/service/apis@2024-05-01' =
786790
description: 'Kitchen sink synthetic GraphQL API with inline schema'
787791
path: 'ks/graphql'
788792
protocols: ['https']
789-
serviceUrl: 'https://httpbin.org/post'
793+
serviceUrl: 'https://countries.trevorblades.com/graphql'
790794
type: 'graphql'
791795
apiType: 'graphql'
792796
}
@@ -813,7 +817,7 @@ resource apiGraphqlPassthrough 'Microsoft.ApiManagement/service/apis@2024-05-01'
813817
description: 'Kitchen sink pass-through GraphQL API'
814818
path: 'ks/graphql-pt'
815819
protocols: ['https']
816-
serviceUrl: 'https://httpbin.org/post'
820+
serviceUrl: 'https://countries.trevorblades.com/graphql'
817821
type: 'graphql'
818822
apiType: 'graphql'
819823
}

0 commit comments

Comments
 (0)