-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor: Cleanup SchemaProxy
#132
Conversation
Tests are running (and there are several related ones) but removing the |
@@ -461,4 +453,10 @@ class SchemaCompilation( | |||
transformation = transformation as Transformation<T, R>? | |||
) | |||
} | |||
|
|||
private fun typenameField(functionWrapper: FunctionWrapper<String>) = Field.Function( |
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.
This definition skips all stuff previously done in handleOperation
but IMHO that stuff is not necessary for the __typename
: We already know the return type and we know that there are no input values.
}, true)) | ||
) | ||
val __typenameField = typenameField(FunctionWrapper.on({ value: Any -> | ||
queryTypeProxies[value.javaClass.kotlin]?.name ?: error("No query type proxy found for $value") |
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.
typeByKClass
is doing model.queryTypes[kClass]
with queryTypes = queryTypeProxies + enums + scalars
, so a bit different.
IMHO this is still fine as according to the spec the __typename
is available "on any Object, Interface, or Union" - i.e. no enums or scalars.
ff0d534
to
05fd701
Compare
05fd701
to
6f67c79
Compare
6f67c79
to
a039cad
Compare
3aed18f
to
fe52c50
Compare
`SchemaProxy` is (from my understanding) only a wrapper for schema introspection, and as such should not need to deal with Kotlin classes or offer execution options. This commit also removes some more unused code.
a039cad
to
3b4af49
Compare
SchemaProxy
is (from my understanding) only a wrapper for schema introspection, and as such should not need to deal with Kotlin classes or offer execution options. This commit also removes some more unused code.