Graphql search query post not working

Posted by: amirreza_asadpour on 3 June 2023, 11:01 pm EST

    • Post Options:
    • Link

    Posted 3 June 2023, 11:01 pm EST - Updated 3 June 2023, 11:12 pm EST

    search post query in graphql not work:

    i have graphql quer like below :

    {getirTax_Reports(search: { id: 1583 }) {id,Sale_Hdr_IDGen,taxid,indatim,Indati2m,inty,inno,irtaxid,inp } }

    in my report i defined a parameter for id and it’s name in invoice_id

    i want to replace the invoice_id wirh 1583 in my post query but it doesn’t work please help me

    my post body query is :

    {{"query":"{{getirTax_Reports(search:(id:{@invoice_id})){{id,Sale_Hdr_IDGen,taxid,indatim,Indati2m,inty,inno,irtaxid,inp}}"}

    the error is :

    Incorrect query string

    *Unable to load data from “http://localhost:4000/graphql”: 400 {“errors”:[{“message”:“Syntax Error: Unexpected "(".”,“locations”:[{“line”:1,“column”:26}],“extensions”:{“code”:“GRAPHQL_PARSE_FAILED”,“stacktrace”:[“GraphQLError: Syntax Error: Unexpected "(".”," at syntaxError (D:\MyProjects\nvweb\backend\node_modules\graphql\error\syntaxError.js:15:10)“,” at Parser.unexpected

    when i use my query withou search it works correctly and the correct one is like below whithout search :

    {{"query":"{{getirTax_Reports{{id,Sale_Hdr_IDGen,taxid,indatim,Indati2m,inty,inno,irtaxid,inp}}"}
  • Posted 5 June 2023, 11:49 pm EST

    Hi Amirreza,

    The parameter seems to be working fine at my end. Please provide us with a sample report with dummy data reproducing the issue so we can test this behavior at our end and get back to you accordingly.

    For reference, I have also attached a sample report file where I am using a report parameter in the query.

    ParameterizedGraphQLReport.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels