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

[schema-stitching]: Alias arguments: Fields X conflict because they have differing arguments. #415

Closed
pozylon opened this issue Oct 5, 2017 · 1 comment

Comments

@pozylon
Copy link
Contributor

pozylon commented Oct 5, 2017

Now with #411 this query results in the correct response now:

{
  orders {
    itemTotal: total(category: TAXES) {
      amount
      currency
    }
  }
}

But as soon as you add a second alias with the same field and different arguments, new errors pop up.
This one works:

{
  orders {
    itemTotal: total {
      amount
      currency
    }
    taxesTotal: total {
      amount
      currency
    }
  }
}

But that one here does not:

{
  orders {
    itemTotal: total(category: ITEMS) {
      amount
      currency
    }
    taxTotal: total(category: TAXES) {
      amount
      currency
    }
    paymentTotal: total(category: PAYMENT) {
      amount
      currency
    }
    deliveryTotal: total(category: DELIVERY) {
      amount
      currency
    }
    netTotal: total(category: NET) {
      amount
      currency
    }
  }
}

Response is:

{
  "data": null,
  "errors": [
    {
      "message": "Fields \"total\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.\nFields \"total\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.\nFields \"total\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.\nFields \"total\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.\nFields \"total\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.\nFields \"total\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.\nFields \"total\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.\nFields \"total\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.\nFields \"total\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.\nFields \"total\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "orders"
      ]
    }
  ]
}

And this is the result when firing the same query directly to the proxied server:

{
  "data": {
    "orders": [
      {
        "itemTotal": {
          "amount": 5958,
          "currency": "CHF"
        },
        "taxTotal": {
          "amount": 441,
          "currency": "CHF"
        },
        "paymentTotal": {
          "amount": 0,
          "currency": "CHF"
        },
        "deliveryTotal": {
          "amount": 0,
          "currency": "CHF"
        },
        "netTotal": {
          "amount": 5958,
          "currency": "CHF"
        }
      },...

Ugly workaround at the moment:

{
  order {
    total(category: TAXES) {
      amount
      currency
    }
  }
  taxes: order {
    total(category: ITEMS) {
      amount
      currency
    }
  }
}
@freiksenet
Copy link
Contributor

Should be fixed in #418.

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

No branches or pull requests

2 participants