Hey folks, we're writing some integration tests th...
# graphql-kotlin
d
Hey folks, we're writing some integration tests that require a different schema from the main schema. We have defined this new schema in a different package
package.testschema
as opposed to the package where the normal schema is defined
package.schema
and overwrite the
graphql.packages
property in the tests to look in only
package.testschema
. This however causes the following error
Caused by: com.expediagroup.graphql.generator.exceptions.TypeNotSupportedException: Cannot convert package.schema.foo since it is not a valid GraphQL type or outside the supported packages "[package.testschema]"
. Any ideas what we can do about this?
d
It looks like your integration test schema is pulling stuff from main schema. You are getting a failure as you only specified test package to be scanned
Supported packages is an array so if you need main schema + additional int schema data then configure both for integration test
If you are using spring to autowire beans and want to exclude main schema beans -> make them conditonal (eg can use spring profiles or some property) or create beans in config so you can better control what gets included in spring app context
d
Thanks for the response. I'm not sure that any of these are feasible
s
The error message indicates what type is causing the issue:
Cannot convert package.schema.foo
So you need to do a find usage of that type inside your
package.testschema
directory to see if you need to make a new copy in the new directory or if you should infact be including both
package.testschema
and
package.schema
when building the
testschema