Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query demands required parameter after version update #1078

Open
QnavWhat opened this issue Jul 3, 2024 · 9 comments
Open

Query demands required parameter after version update #1078

QnavWhat opened this issue Jul 3, 2024 · 9 comments

Comments

@QnavWhat
Copy link

QnavWhat commented Jul 3, 2024

Hi,
I just updated from Version 6.3.0 to 6.6.0 and without changing the queries, I get the following error message when running GraphQL calls:

{"(400 Bad Request) query: Required parameter missing or invalid"}

The same query runs fine with the previous version and I could find any change log with related information. The higher versions I tested return this message as well. I get the error message for every query I tested like ''query MyQuery { shop { name } }". When using e.g. POSTMAN I can run the query without exception.

Thanks and regards

@nozzlegear
Copy link
Owner

Hey @QnavWhat! Can you post the code you're using to send the query?

@QnavWhat
Copy link
Author

QnavWhat commented Jul 4, 2024

Hi @nozzlegear
this is a code snippet to reproduce

Public Shared Function GraphQL_Query() As String

    Dim ret As String = ""

    Try
        Dim loc = ShopifyHelper2024.serviceLocation.ListAsync().Result.Items.First
        Console.WriteLine(loc.Id)

        Dim body = "query { shop { id name } }"
        Dim res = ShopifyHelper2024.serviceGraphQL.PostAsync(body:=body).Result
        ret = res("shop")("name")
        Console.WriteLine(ret)

    Catch ex As Exception
        ret = ex.Message
    End Try

    Return ret

End Function

The first call to serviceLocation is returning the location ID, which I just added to verify a correct initialisation of ShopifyHelper2024. Running the exact code with Version 6.4.0 will return Shop-Name but with Version 6.6.0 it will return error 400.

@QnavWhat
Copy link
Author

Is there anything I can try t to adapt in my API-call?

@nozzlegear
Copy link
Owner

Hey @QnavWhat! Sorry, this slipped my mind. I’m currently making my way back home on a road trip so I can’t dig into any code. Can you try upgrading to the latest version of ShopifySharp to see if that fixes the problem?

@QnavWhat
Copy link
Author

QnavWhat commented Aug 1, 2024

I tried using Version 6.18.0 to see the output. However a different error appeared. So I ran through the Version to test where related changes happend:

6.4.0 --> fine with the code posted above
6.6.0-b118 --> {"(400 Bad Request) query: Required parameter missing or invalid"}
6.13.0-b182 --> {"Auf das verworfene Objekt kann nicht zugegriffen werden." & vbCrLf & "Objektname: ""System.Net.Http.StringContent""."}
6.18.0 --> still last error (which I guess relates to this issue #1080)

@QnavWhat
Copy link
Author

QnavWhat commented Sep 9, 2024

Hey @nozzlegear , ist my latest post somehow helpful?

@nozzlegear
Copy link
Owner

@QnavWhat it is helpful, yes! I'm sorry, I've been utterly swamped. I've set aside time to look at this and other ShopifySharp issues later this evening.

@nozzlegear
Copy link
Owner

Good news! I've found the issue, it's one of the overloads in the GraphService, which I have an open pull request for. I'm working on it right now, I'll publish it either tonight or tomorrow and will let you know when it's ready to test.

@QnavWhat
Copy link
Author

Awesome, thanks a lot :)
Will test that asap after your publish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants