-
Notifications
You must be signed in to change notification settings - Fork 2k
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
buildSchema
should be able to create fully featured schema
#1987
base: main
Are you sure you want to change the base?
Conversation
97b4b9b
to
1b0f68a
Compare
src/utilities/buildASTSchema.js
Outdated
@@ -72,6 +73,11 @@ import { | |||
GraphQLSchema, | |||
} from '../type/schema'; | |||
|
|||
export type TypeFieldResolverMap = ObjMap< | |||
| ObjMap<GraphQLFieldResolver<mixed, mixed, mixed>> /* type and interface */ | |||
| ObjMap<any> /* enum */, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this much because any
for enum will eat resolvers for object types.
Should I wrap enum values to object with key one key values
? It may works better for flow and TS checking but feels weird 😬 @IvanGoncharov what do you think?
@langpavel Thanks, for PR 👍 Since this is a very complex feature and we would need the ability to iterate on it without doing breaking changes I want to postpone this particular feature after Meanwhile, I need to think about the general API design and how to handle a thing like this: scalar CustomScalarWithValidationRule
directive @SomeDirective(arg: CustomScalarWithValidationRule) on FIELD_DEFINITION
type Query {
foo: String @SomeDirective(arg: "<Invalid value for custom scalar>")
bar(arg: CustomScalarWithValidationRule = "<Invalid value for custom scalar>")
} We need ability to provide |
I definitely agree that this may be complex feature, but if you look into this PR, it's actually really easy to follow whats happens.
Ok, this ones:
This is already partially covered here: 396098e const scalarConfig = options.resolvers['CustomScalarWithValidationRule'];
const { serialize, parseValue, parseLiteral } = scalarConfig; Because Please, consider this merging soon, as this is only thing which allow me to drop |
396098e
to
a1b8520
Compare
Related: ardatan/graphql-tools#1456 changes graphql-tools to no longer modify original schema in place and instead return a new rewired schema. |
@cvbedc Unknown command 😕 Supported commandsPlease post this commands in separate comments and only one per comment:
|
buildSchema
,buildASTSchema
andextendSchema
:DONE: 🎉
enum
value lookup (exactly like previous) 1b0f68aTO DO, need help:
isTypeOf
on ObjectType (should I followgraphql-tools
with__isTypeOf
?)resolveType
on UnionType (same question as above)Related: #1384 #1858
/cc @IvanGoncharov, @leebyron