graphql-schemax
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.0.9](https://github.com/nicolasdao/graphql-schemax/compare/v0.0.8...v0.0.9) (2021-11-07) | ||
### Bug Fixes | ||
* Nested complex objects are ignored ([b140f1c](https://github.com/nicolasdao/graphql-schemax/commit/b140f1cbee36d79a4ddb835575e7b2182251dbb2)) | ||
### [0.0.8](https://github.com/nicolasdao/graphql-schemax/compare/v0.0.7...v0.0.8) (2021-11-01) | ||
@@ -7,0 +14,0 @@ |
{ | ||
"name": "graphql-schemax", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Creates GraphQL string schema from plain JSON objects.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -98,3 +98,7 @@ # GRAPHQL-SCHEMAX | ||
> - [Required anonymous types](#required-anonymous-types) | ||
> - [Required anonymous Type and Input](#required-anonymous-type-and-input) | ||
> - [Required anonymous Enum](#required-anonymous-enum) | ||
> - [Naming anonymous types](#naming-anonymous-types) | ||
> - [Naming anonymous Type and Input](#naming-anonymous-type-and-input) | ||
> - [Naming anonymous Enum](#naming-anonymous-enum) | ||
> - [Directives](#directives) | ||
@@ -307,2 +311,3 @@ > * [APIs](#apis) | ||
## Required anonymous types | ||
### Required anonymous Type and Input | ||
@@ -350,3 +355,38 @@ Use the `__required` property as follow: | ||
### Required anonymous Enum | ||
To make an anonymous enum required, use the reserved `__required` string: | ||
```js | ||
const schema = [ | ||
'type Query', { | ||
products:{ type:['car','home','furniture','__required'], ':':{ name:'String' } } | ||
} | ||
] | ||
console.log(new Schemax(schema).toString()) | ||
``` | ||
```js | ||
type Query { | ||
products(type: Enum_11845869194!): Type_12078318863 | ||
} | ||
enum Enum_11845869194 { | ||
car | ||
furniture | ||
home | ||
} | ||
type Type_12078318863 { | ||
name: String | ||
} | ||
schema { | ||
query: Query | ||
} | ||
``` | ||
## Naming anonymous types | ||
### Naming anonymous Type and Input | ||
@@ -395,2 +435,36 @@ Use the `__name` property as follow: | ||
### Naming anonymous Enum | ||
To use a custom enum, use the reserved `__name:YOUR_NAME` string: | ||
```js | ||
const schema = [ | ||
'type Query', { | ||
products:{ type:['car','home','furniture','__name:ProductTypeEnum'], ':':{ name:'String' } } | ||
} | ||
] | ||
console.log(new Schemax(schema).toString()) | ||
``` | ||
```js | ||
type Query { | ||
products(type: ProductTypeEnum): Type_12078318863 | ||
} | ||
enum ProductTypeEnum { | ||
car | ||
furniture | ||
home | ||
} | ||
type Type_12078318863 { | ||
name: String | ||
} | ||
schema { | ||
query: Query | ||
} | ||
``` | ||
## Directives | ||
@@ -397,0 +471,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47825
611
1125