-
Notifications
You must be signed in to change notification settings - Fork 362
Add additionalTypes to generateSchema #622
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
Conversation
@de55 I was just looking at this last night and realized our mistake. Thank you for all being on top of changes as an active community member. How about instead of changing the scope of open fun generateSchema(
queries: List<TopLevelObject>,
mutations: List<TopLevelObject> = emptyList(),
subscriptions: List<TopLevelObject> = emptyList(),
additionalTypes: Set<KType> = emptySet()
): GraphQLSchema {
this.additionalTypes.addAll(additionalTypes)
val builder = GraphQLSchema.newSchema()
// ... rest of code
} Then we can make |
If you update the scope of /**
* Generate the GraphQL type for all the `additionalTypes`. They are generated as non-inputs and not as IDs.
* If you need to provide more custom additional types that were not picked up from reflection of the schema objects,
* you can provide more types to be added through [generateSchema].
*
* This function loops because while generating the additionalTypes it is possible to create more additional types that need to be processed.
*/ |
...otlin-schema-generator/src/main/kotlin/com/expediagroup/graphql/generator/SchemaGenerator.kt
Outdated
Show resolved
Hide resolved
This is a major change on the master branch since we removed the open modified on |
* Make additionalType public * fix linting issue * Update SchemaGenerator.kt * Switch additionalTypes back to internal * fix federated schema
📝 Description
Additional types cannot be edited, but comments suggest that is the appropriate way to add additional types before generateAdditionalTypes() is called:
🔗 Related Issues
#615