Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use resolvers for unions and interface type in mockServer #101

Closed
itajaja opened this issue Aug 10, 2016 · 0 comments · Fixed by #102
Closed

use resolvers for unions and interface type in mockServer #101

itajaja opened this issue Aug 10, 2016 · 0 comments · Fixed by #102

Comments

@itajaja
Copy link
Contributor

itajaja commented Aug 10, 2016

mockServer ignores the resolve function for implementation of union or interface types. For example this mockMap:

const mockMap = {
      Int: () => 12345,
      Bird: () => ({ returnInt: () => 54321 }),
      Bee: () => ({ returnInt: () => 54321 }),
    };

on this schema:

type Bird {
  returnInt: Int
}

type Bee {
  returnInt: Int
}

union BirdsAndBees = Bird | Bee

type RootQuery {
  returnBirdsAndBees: [BirdsAndBees]
}

schema {
  query: RootQuery
}

with the following query:

  {
      returnBirdsAndBees {
        ... on Bird {
          returnInt
          returnString
        }
        ... on Bee {
          returnInt
          returnEnum
        }
      }
    }

returns 12345 instead of 54321

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant