xogroup / joi2gql Goto Github PK
View Code? Open in Web Editor NEWConversion of Joi schemas into GraphQL data types
License: Other
Conversion of Joi schemas into GraphQL data types
License: Other
https://github.com/hapijs/joi/blob/v10.6.0/API.md#lazyfn---inherits-from-any
Example Schema
const schema = Joi.object().keys({
name: Joi.string,
age : Joi.number().integer()
team: Joi.array().items(Joi.lazy(() => schema)
})
- Take a more defensive approach to traversing deeply nested properties. Should use
Hoek.reach()
api.
- Refactor unit and integration tests. Remove GITS references.
Gitbook Might be overkill, but looks nice.
I was thinking of using this package in a live project but it was last updated 5 years ago so I was wondering when you are going to update it?
Vodou. That could be cool
Over on Gatsby I've been upgrading joi to the latest version. However this is the final holdout to make that happen. It looks like there are a number of changes made to joi that make this library incompatible.
Things like schema._tests
and schema._flags
aren't supported as they are for internal use.
Are there any plans to support the latest joi?
type-dictionary
8
node
const Joi2GQL = require('joi2gql');
const Joi = require('joi');
const schema = Joi.object().keys({
prop1: Joi.string().lowercase(),
prop2: Joi.number().integer(),
prop3: Joi.object().keys({
key1: Joi.string(),
key2: Joi.string()
})
});
const Schema = Joi2GQL.transmuteType(schema);
const gqlschema = {
query: {
schema: Schema
}
}
const mySchema = Joi2GQL.transmuteSchema(gqlschema);
For a valid GraphQL object to be returned
// Anon.prop1 field type must be Output Type but got: undefined
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.