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

Enum value mapping resolvers #299

Closed
ccollie opened this issue Nov 9, 2020 · 1 comment · Fixed by #303
Closed

Enum value mapping resolvers #299

ccollie opened this issue Nov 9, 2020 · 1 comment · Fixed by #303
Labels

Comments

@ccollie
Copy link

ccollie commented Nov 9, 2020

Is there support for the following ?

const typeDefs = gql`
  enum AllowedColor {
    RED
    GREEN
    BLUE
  }
  type Query {
    pickColor(color: AllowedColor): String
  }
`;
const resolvers = {
  AllowedColor: {
    RED: '#f00',
    GREEN: '#0f0',
    BLUE: '#00f',
  },
  Query: {
    pickColor(_, { color }) {
      return color;
    }
  }
};

schemaComposer.addResolveMethods() doesn't like the AllowedColor map

@github-actions
Copy link

🎉 This issue has been resolved in version 7.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

1 participant