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
When I modify example/resources/tuples.js to contain an array of objects, I get an error. I checked that it works with generic "Joi" though, and according to json-api spec: "Complex data structures involving JSON objects and arrays are allowed as attribute values.".
It seems like a bug... but perhaps there is a reason for it? Why not use Joi directly (which seems to be extensible for relationship types)?
1) Testing jsonapi-server "before all" hook:
Error: Unable to parse Joi type, got {"isJoi":true,"_type":"object","_settings":null,"_valids":{"_set":[]},"_invalids":{"_set":[]},"_tests":[],"_refs":[],"_flags":{},"_description":null,"_unit":null,"_notes":[],"_tags":[],"_examples":[],"_meta":[],"_inner":{"children":null,"renames":[],"dependencies":[],"patterns":[]}}
at Object.joiConverter.simpleAttribute.joiScheme [as simpleAttribute] (lib/graphQl/joiConverter.js:38:11)
at Object.joiConverter.simpleAttribute.joiScheme [as simpleAttribute] (lib/graphQl/joiConverter.js:22:38)
at Object.joiConverter.swap (lib/graphQl/joiConverter.js:46:25)
at Object.keys.forEach.attribute (lib/graphQl/readTypes.js:41:30)
at Array.forEach (native)
at fields (lib/graphQl/readTypes.js:36:46)
at resolveThunk (node_modules/graphql/type/definition.js:115:40)
at defineFieldMap (node_modules/graphql/type/definition.js:265:18)
at GraphQLObjectType.getFields (node_modules/graphql/type/definition.js:235:44)
at node_modules/graphql/type/schema.js:207:27
at typeMapReducer (node_modules/graphql/type/schema.js:219:7)
at typeMapReducer (node_modules/graphql/type/schema.js:187:12)
at node_modules/graphql/type/schema.js:217:22
at Array.forEach (native)
at node_modules/graphql/type/schema.js:208:29
at typeMapReducer (node_modules/graphql/type/schema.js:219:7)
at Array.reduce (native)
at new GraphQLSchema (node_modules/graphql/type/schema.js:95:34)
at Object.jsonApiGraphQL.generate.allResourceConfig [as generate] (lib/graphQl/index.js:29:10)
at Object.jsonApiGraphQL.with.app [as with] (lib/graphQl/index.js:17:28)
at Object.router.applyMiddleware (lib/router.js:76:15)
at Object.jsonApi.start (lib/jsonApi.js:116:10)
at Context.before (test/404.js:38:23)
The text was updated successfully, but these errors were encountered:
A member of the community kindly implemented array support (we don't have object support in master yet). They added in some build-time throwing of Errors to make the lack of support for objects more obvious (the GraphQl errors are a bit... mind boggling). The errors you're seeing is that validation kicking in.
When I modify example/resources/tuples.js to contain an array of objects, I get an error. I checked that it works with generic "Joi" though, and according to json-api spec: "Complex data structures involving JSON objects and arrays are allowed as attribute values.".
It seems like a bug... but perhaps there is a reason for it? Why not use Joi directly (which seems to be extensible for relationship types)?
I get the following error:
The text was updated successfully, but these errors were encountered: