public async Task <Owner> UpdateOwner(Guid id, OwnerInput ownerToUpdate) { var query = new GraphQLRequest { Query = @" mutation($owner: ownerInput!, $ownerId: ID!){ updateOwner(owner: $owner, ownerId: $ownerId){ id, name, address } }", Variables = new { owner = ownerToUpdate, ownerId = id } }; var response = await _client.PostAsync(query); return(response.GetDataFieldAs <Owner>("updateOwner")); }
public async Task <Owner> UpdateOwner(Guid id, OwnerInput ownerToUpdate) { var query = new GraphQLRequest { Query = @" mutation($owner: ownerInput!, $ownerId: ID!){ updateOwner(owner: $owner, ownerId: $ownerId){ id, name, address } }", Variables = new { owner = ownerToUpdate, ownerId = id } }; var response = await _client.SendMutationAsync <ResponseOwnerType>(query); return(response.Data.Owner); }
public async Task <Owner> CreateOwner(OwnerInput ownerToCreate) { var query = new GraphQLRequest { Query = @" mutation($owner: ownerInput!){ createOwner(owner: $owner){ id, name, address } }", Variables = new { owner = ownerToCreate } }; var response = await _client.PostAsync(query); return(response.GetDataFieldAs <Owner>("createOwner")); }
public async Task <Owner> CreateOwner(OwnerInput ownerToCreate) { var query = new GraphQLRequest { Query = @" mutation($owner: ownerInput!){ createOwner(owner: $owner){ id, name, address } }", Variables = new { owner = ownerToCreate } }; var response = await _client.SendMutationAsync <ResponseOwnerType>(query); return(response.Data.Owner); }