Added unique keyword

This commit is contained in:
2021-04-06 09:06:52 +10:00
parent f4b330eac3
commit 972866a704
7 changed files with 37 additions and 15 deletions

View File

@@ -103,12 +103,13 @@ wave('Author { name books { title } }')
## The Schema Language
The schema language is a layout of how queries should be made, as well as what can be made with them. There are two built-in keywords for the schema language:
The schema language is a layout of how queries should be made, as well as what can be made with them. There are several built-in keywords for the schema language:
* type
* scalar
* unique
`type` is used for defining new compound types. `scalar` is for defining new scalar types, such as `Date`.
`type` is used for defining new compound types. `scalar` is for defining new scalar types, such as `Date`. `unique` is a modifier on a field, indicating that it is unique in the database.
The built-in types for the schema language are:
@@ -123,12 +124,12 @@ These can be combined into compound types as so:
scalar Date
type Book {
String title
unique String title
Date published
}
type Author {
String name
unique String name
Book books
}
```