You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.../node_modules/@superfaceai/one-service/dist/schema.types.js:235
throw new Error(`Variable type not implemented for: ${structure.kind}`);
^
Error: Variable type not implemented for: UnionStructure
at outputType (.../node_modules/@superfaceai/one-service/dist/schema.types.js:235:19)
at outputType (.../node_modules/@superfaceai/one-service/dist/schema.types.js:231:46)
at .../node_modules/@superfaceai/one-service/dist/schema.types.js:219:27
at Array.forEach (<anonymous>)
at outputType (.../node_modules/@superfaceai/one-service/dist/schema.types.js:217:89)
at outputType (.../node_modules/@superfaceai/one-service/dist/schema.types.js:231:46)
at generateStructureResultType (.../node_modules/@superfaceai/one-service/dist/schema.types.js:102:18)
at generateUseCaseFieldConfig (.../node_modules/@superfaceai/one-service/dist/schema.types.js:60:24)
at generateProfileTypes (.../node_modules/@superfaceai/one-service/dist/schema.types.js:28:36)
at generate (.../node_modules/@superfaceai/one-service/dist/schema.js:41:91)
After some dive to unions in GraphQL, I don't see a way how to support them. Because GraphQL doesn't allow unions in input at all and for outputs it must be an object.
So only unions defined in Comlink as below would work.
model WeatherInformation {
airTemperature
atmosphericPressure
}
model WeatherDetailedInformation {
airTemperature
atmosphericPressure
wind
windGusts
rain
}
model WeatherData WeatherInformation | WeatherDetailedInformation
Since the limitation in GraphQL is big, I wouldn't implement it. Also because the union in profile can be rewritten to single type.
Action item here is to document it in README as known limitation.
There is new specification and suggested as an alternative for unions for inputs. It is called OneOf Input Objects. Once implementation is merged, we should be able to use it to map Comlink Profile Unionsas OneOf Input Objects.
Given a union structure in profile like this:
I recieve this exception on one-service start:
Profile example
The text was updated successfully, but these errors were encountered: