-
Notifications
You must be signed in to change notification settings - Fork 23
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
Never wiring factory tweaks #642
base: master
Are you sure you want to change the base?
Conversation
@@ -39,7 +39,7 @@ def releaseVersion = System.env.RELEASE_VERSION | |||
version = releaseVersion ? releaseVersion : getDevelopmentVersion() | |||
group = "com.atlassian" | |||
allprojects { | |||
description = "Nadel is a Java library that combines multiple GrahpQL services together into one API." | |||
description = "Nadel is a Kotlin library that combines multiple GraphQL services together into one GraphQL API." |
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.
Bugged me
@@ -100,18 +100,31 @@ open class NeverWiringFactory : WiringFactory { | |||
} | |||
|
|||
override fun providesDataFetcher(environment: FieldWiringEnvironment): Boolean { | |||
return true | |||
return false |
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.
So we dont create a DF per field or make a CodeRegistry entry per field as well but rather use a default
} | ||
|
||
override fun getDefaultDataFetcher(environment: FieldWiringEnvironment): DataFetcher<*>? { | ||
return null |
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.
no default makes it use CodeRegistry default
val schema = overallSchemaGenerator.buildOverallSchema( | ||
serviceRegistries, | ||
builder.overallWiringFactory, | ||
NeverWiringFactory.NEVER_CODE_REGISTRY |
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.
Why is this passed in? Seems like it should be baked into OverallSchemaGenerator
@@ -84,9 +86,7 @@ open class NeverWiringFactory : WiringFactory { | |||
} | |||
|
|||
override fun getTypeResolver(environment: InterfaceWiringEnvironment): TypeResolver { |
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.
Can we make all of these resolves like functions final
e.g.
final override fun getTypeResolver(environment: InterfaceWiringEnvironment): TypeResolver {
return NEVER_TR
}
Feels like they should never be overriden because we should always delegate to the hardcoded NEVER_CODE_REGISTRY
@@ -24,10 +25,12 @@ internal class OverallSchemaGenerator { | |||
fun buildOverallSchema( | |||
serviceRegistries: List<NadelDefinitionRegistry>, | |||
wiringFactory: WiringFactory, | |||
codeRegistry: GraphQLCodeRegistry, |
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.
Think this should be hardcoded if it's not an option in the NadelSchemas.Builder
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.
Can we apply the same thing to UnderlyingSchemaGenerator
?
This bumps the graphql-java version which has the singleton DF code
And it returns a single DF as a default