hasura / ra-data-hasura

react-admin data provider for Hasura GraphQL Engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please provide a documentation example for custom mutations

gabrielpalladini opened this issue · comments

I'm trying to use a custom mutation, but the dataprovider does some strange things to my query:

mutation UpdateValidityDateRangeByDiscountId($id: uuid!, $validityDateRange: daterange) {
  update_discount_by_pk(pk_columns: {id: $id}, _set: {validityDateRange: $validityDateRange}) {
    active
    code
    created_at
    discount
    id
    redemptionCount
    rules
    updated_at
    validityDateRange
    vatId
  } 
}

Console error:

Error: GraphQL error: field "update_discount_by_pk" not found in type: 'discount_expanded_validitydaterange'

I did not find any hints in the documentation why this could be happening. How would an appropriate mutation have to look like? Could you please provide some examples(documentation on how should a mutation look like).

Thanks

PS. Issue simular to #49 closed without answer.

Ill try to create an example, in the meantime does this comment help at all? #70 (comment)

An example will be very helpful