graphql-schemax
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.0.11](https://github.com/nicolasdao/graphql-schemax/compare/v0.0.10...v0.0.11) (2021-11-13) | ||
### Bug Fixes | ||
* Arrays of Enums nested in objects are not serialized into arrays ([1c72fef](https://github.com/nicolasdao/graphql-schemax/commit/1c72fef8a748a948e6af955c19fa61928e8119f3)) | ||
### [0.0.10](https://github.com/nicolasdao/graphql-schemax/compare/v0.0.9...v0.0.10) (2021-11-07) | ||
@@ -7,0 +14,0 @@ |
{ | ||
"name": "graphql-schemax", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "Creates GraphQL string schema from plain JSON objects.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -100,2 +100,3 @@ # GRAPHQL-SCHEMAX | ||
> - [Required anonymous Enum](#required-anonymous-enum) | ||
> - [Required non-empty anonymous array](#required-non-empty-anonymous-array) | ||
> - [Naming anonymous types](#naming-anonymous-types) | ||
@@ -368,2 +369,4 @@ > - [Naming anonymous Type and Input](#naming-anonymous-type-and-input) | ||
Which outputs: | ||
```js | ||
@@ -389,2 +392,50 @@ type Query { | ||
### Required non-empty anonymous array | ||
Use the `__noempty` keyword to create enums similar to `[RoleEnum!]`. | ||
```js | ||
const schema = [ | ||
'type Mutation', { | ||
invite: { users:[{ | ||
id:'ID', | ||
email:'String', | ||
roles:[['admin','writer','reader','__required','__noempty','__name:RoleEnum']], | ||
__noempty:true, | ||
__name:'UserInviteInput' | ||
}], ':':{ message:'String', __name:'Message' } } | ||
} | ||
] | ||
console.log(new Schemax(schema).toString()) | ||
``` | ||
Which outputs: | ||
```js | ||
type Mutation { | ||
invite(users: [UserInviteInput!]): Message | ||
} | ||
enum RoleEnum { | ||
admin | ||
reader | ||
writer | ||
} | ||
input UserInviteInput { | ||
id: ID | ||
email: String | ||
roles: [RoleEnum!]! | ||
} | ||
type Message { | ||
message: String | ||
} | ||
schema { | ||
mutation: Mutation | ||
} | ||
``` | ||
## Naming anonymous types | ||
@@ -391,0 +442,0 @@ ### Naming anonymous Type and Input |
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
52078
700
1176