Пример #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"));
        }
Пример #2
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.SendMutationAsync <ResponseOwnerType>(query);

            return(response.Data.Owner);
        }
Пример #3
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"));
        }
Пример #4
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.SendMutationAsync <ResponseOwnerType>(query);

            return(response.Data.Owner);
        }