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

resolveType config parameter should be optional on StrongInterfaceTypeConfig type #4

Open
karoun opened this issue Dec 28, 2017 · 0 comments

Comments

@karoun
Copy link

karoun commented Dec 28, 2017

As explained by @leebyron in this issue comment, there exists an alternative to the resolveType interface method in the form of isTypeOf methods on the objects implementing the interface (see also #3).

The resolveType parameter should be made optional to support this default behavior.

/**
* The configuration object to be used when creating interface types. It
* requires `resolveType` and `fields`.
*/
export type StrongInterfaceTypeConfig<TValue, TFieldMap extends StrongInterfaceFieldMap> = {
readonly name: string,
readonly description?: string | undefined,
readonly resolveType: (value: TValue) => StrongObjectType<TValue, never>,
readonly fields: StrongInterfaceFieldMapConfig<TFieldMap>,
};

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