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

fulfillmentTrackingInfoUpdateV2 Graph API request unable to parse the success response. #1149

Open
iamSathishMohan opened this issue Jan 30, 2025 · 3 comments · May be fixed by #1154
Open
Labels
bug graphql serialization Anything affecting json or http content serialization.
Milestone

Comments

@iamSathishMohan
Copy link

I was using the below graph API request to update the fulfillment tracking info, eventhrough it produces the success response, the GraphService is unable to parse and failing with Expected StartObject token error for path $[0].extensions.value.

mutation fulfillmentTrackingInfoUpdateV2(
  $fulfillmentId: ID!
  $trackingInfoInput: FulfillmentTrackingInput!
  $notifyCustomer: Boolean
) {
  fulfillmentTrackingInfoUpdateV2(
    fulfillmentId: $fulfillmentId
    trackingInfoInput: $trackingInfoInput
    notifyCustomer: $notifyCustomer
  ) {
    fulfillment {
      id
      status
      trackingInfo {
        company
        number
        url
      }
    }
    userErrors {
      field
      message
    }
  }
}

The same query executes fine in postman

@nozzlegear nozzlegear added bug serialization Anything affecting json or http content serialization. labels Jan 30, 2025
@nozzlegear
Copy link
Owner

Hey, thanks for the report @iamSathishMohan! Could you show the C# code you're using to send this mutation? And can you confirm whether you're using ShopifySharp v6.22.0 or v6.22.1?

@iamSathishMohan
Copy link
Author

I am using the latest ShopifySharp. Found the error i made with the request and corrected it. But this still needs fix in ShopifySharp. The following error response in GraphQL is not processed and thorwing deserialization error.

{
    "errors": [
        {
            "message": "Variable $trackingInfoInput of type FulfillmentTrackingInput! was provided invalid value",
            "locations": [
                {
                    "line": 5,
                    "column": 3
                }
            ],
            "extensions": {
                "value": "{\"company\":\"Custom\",\"numbers\":[\"xxxxxxxxxxxx\",\"xxxxxxxxxxxx\"],\"urls\":[\"https://track.com/tracking/xxxxxxxxxxxx\",\"https://track.com/tracking/xxxxxxxxxxxx\"]}",
                "problems": [
                    {
                        "path": [],
                        "explanation": "Expected \"{\\\"company\\\":\\\"Custom\\\",\\\"numbers\\\":[\\\"xxxxxxxxxxxx\\\",\\\"xxxxxxxxxxxx\\\"],\\\"urls\\\":[\\\"https:\/\/track.com\/tracking\/xxxxxxxxxxxx\\\",\\\"https:\/\/track.com\/tracking\/xxxxxxxxxxxx\\\"]}\" to be a key-value object."
                    }
                ]
            }
        }
    ]
}

@nozzlegear
Copy link
Owner

Ah I see the problem, thanks for copying that json! That helps a ton, I'll make sure this gets fixed.


Note for myself: the errors.extensions.value expects the type to be an object and it's converted to a C# IReadOnlyDictionary<string, object>, but in this json it's string.

Expected:

"extensions": {
  "value": { "foo": "bar" }
}

Actual

"extensions": {
  "value": "bar"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug graphql serialization Anything affecting json or http content serialization.
Projects
Development

Successfully merging a pull request may close this issue.

2 participants