Esempio n. 1
0
        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"));
        }
Esempio n. 2
0
        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"));
        }