Skip to content
This repository was archived by the owner on May 10, 2023. It is now read-only.
This repository was archived by the owner on May 10, 2023. It is now read-only.

Question, handling different response Types #44

@SenhorCastor

Description

@SenhorCastor
            var client = new GraphQLClient("xxx/api/graphql", null, headers, null);
            var request = new Request
            {
                Query = "query FindAccount($userId: Long!) { findAccount(userId: $userId) { " 
                        +"... on Account { id, type, userId, email, expirationDate, lastSubscriptionReminderDate, isDeveloper }"
                        +"... on NotFound { notFound }" 
                        +"... on BadRequestError { type, message }" 
                        +"... on AppError { type, message} } }",
                    Variables = new
                {
                    userId= this.userId().Value()
                }
            };
            var responseType = new { findAccount = new { type ="" , message =""} } ;
            var response = await client.Send( () => responseType, request);

How do I properly work on query that can return multiple response Types?

Thanks in advance
Fer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions