GuoMonth opened a new issue, #10346:
URL: https://github.com/apache/apisix/issues/10346
### Current Behavior
this my request
``` csharp
public async Task<PageData<ClientInfoData>> RetrieveByPage(int index, int
size)
{
GraphQLRequest fetchQuery = new()
{
Query = @"query tClientInfo($pageSize: Int!, $pageIndex:
Int!) {
tClientInfo(
filters: { status: { eq: 1 } }
pagination: { page: { limit: $pageSize, page: $pageIndex } }
orderBy: { updateTime: DESC }
) {
nodes {
id
clientId
clientCode
clientName
status
createUser
createTime
remark
updateTime
updateUser
}
paginationInfo {
pages
current
}
}
}",
Variables = new
{
pageSize = size,
pageIndex = index,
},
};
var token = await
this.LocalStorage.GetItemAsync<string>("Token");
this.GraphqlHttp.HttpClient.DefaultRequestHeaders.Authorization
= new AuthenticationHeaderValue("Bearer", token);
var fetchResJson = await
this.GraphqlHttp.SendQueryAsync<JsonDocument>(fetchQuery);
// ....
}
```
### Expected Behavior
get a respond
### Error Logs
```
2023/10/17 00:55:32 [error] 50#50: *577068048 [lua] ctx.lua:138:
get_parsed_graphql(): failed to parse graphql: Syntax error near line 1 body:
{"query":"query tClientInfo($pageSize: Int!, $pageIndex: Int!) {\n
tClientInfo(\n filters: { status: { eq: 1 } }\n pagination: {
page: { limit: $pageSize, page: $pageIndex } }\n orderBy: { updateTime:
DESC }\n ) {\n nodes {\n id\n clientId\n
clientCode\n clientName\n status\n
createUser\n createTime\n remark\n
updateTime\n updateUser\n }\n paginationInfo {\n
pages\n current\n }\n
}\n}\n","variables":{"pageSize":15,"pageIndex":0}}, client: 172.17.0.15,
server: _, request: "POST /client/graphql HTTP/1.1"
```
### Steps to Reproduce
1. Run APISIX in k8s
2. config route
3. use C# GraphQL.Client.Http.GraphQLHttpClient request.
the route config info:
```yaml
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
name: fx-client-route
spec:
http:
- name: fx-client-rule-1
match:
paths:
- /client/save/*
- /client/find_client_info_by_page
backends:
- serviceName: fx-service-client-service
servicePort: 8007
plugins:
- name: jwt-auth
enable: true
- name: cors
enable: true
- name: fx-client-rule-2
match:
methods: ["GET"]
paths:
- /client/hi
- /client/graphql
backends:
- serviceName: fx-service-client-service
servicePort: 8007
plugins:
- name: cors
enable: true
- name: fx-client-rule-3
match:
methods: ["POST"]
paths:
- /client/graphql
exprs:
- subject:
scope: Variable
name: graphql_operation
op: Equal
value: query
backends:
- serviceName: fx-service-client-service
servicePort: 8007
plugins:
- name: jwt-auth
enable: true
- name: cors
enable: true
```
### Environment
- APISIX image version apache/apisix:3.4.0-debian
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]