Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Enum support for resolver functions #742

Closed
marktani opened this issue Oct 7, 2017 · 5 comments
Closed

Enum support for resolver functions #742

marktani opened this issue Oct 7, 2017 · 5 comments

Comments

@marktani
Copy link
Contributor

marktani commented Oct 7, 2017

What feature are you missing?

Defining an input field in a resolver of type enum like this:

extend type Query {
  fixer(base: Currency, date: DateTime): FixerPayload
}

with the enum

enum Currency {
  USD
  EUR
}

results in this error message when deploying:

Schema Extension Error for function 'fixer-wrapper': Relations are
 ▸    currently not supported. Field 'base':
<snip>

The same error is returned for this payload:

type FixerPayload {
  base: String!
  date: DateTime!

  # might be null, for base
  usd: Currency
}

Enums should be supported as input field types, as well as output field types for resolver functions! 🙂

@vtsatskin
Copy link

@marktani I'm interested in tracking the availability of this feature. Will the closing of this issue mean that it has been implemented?

@johnslemmer
Copy link

I would also like to add a request that not noly Enums but any type defined. I'm trying to return an object I defined in my types.graphql, and it of course won't work.
For the resolvers, graphcool, and API to be fully graphql-esque we shouldn't need to make a second api request. But right now I have to return a primitive (the id of the object) from the resolver and then make a second request for the object via the included CRUD api.
Graphql was created in part to make doing this "second round trip" unnecessary.

@shortjared
Copy link

Just ran into this one as well. Would have expected enums to bubble up from the root types.graphql at least. All other root types would be handy too obviously.

@kbrandwijk
Copy link
Contributor

@johnslemmer Support for model types is also tracked in this issue: https://github.com/graphcool/framework/issues/743.

@marktani
Copy link
Contributor Author

This issue has been moved to graphcool/graphcool-framework.

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

No branches or pull requests

7 participants