diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-09-14 12:18:12 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-09-14 12:18:12 -0400 |
| commit | 2d145b026cfdf54a63bef0b9d6324b6785390307 (patch) | |
| tree | f6c1d8f987437803a5c026e70535bf9ff244e885 /finished-application/frontend/notes.md | |
| parent | 8a5825d52271d712ec7c8348447d433067e13ef2 (diff) | |
move finished folder
Diffstat (limited to 'finished-application/frontend/notes.md')
| -rw-r--r-- | finished-application/frontend/notes.md | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/finished-application/frontend/notes.md b/finished-application/frontend/notes.md new file mode 100644 index 0000000..9ea38ef --- /dev/null +++ b/finished-application/frontend/notes.md @@ -0,0 +1,36 @@ +## Commonly Used Terms + +Mutation + +Query + +Scalar - this means that it's an acutal value and not a relationship. A scalar type of ID might be ABC123, a scalar type of String might be "Wes Bos". These are the default scalar types: + +Int: A signed 32‐bit integer. +Float: A signed double-precision floating-point value. +String: A UTF‐8 character sequence. +Boolean: true or false. +ID + +## The process for adding a new field: + +1. First we need to add the field to our type in datamodel.graphql +2. Then, we need to add it to our schema.graphql file, which is how we define our GraphQL API. Here we will only include the fields that we want to be query-able +3. Now the database needs to know about the new field, so we run `prisma deploy` + +## The process for adding a new type + +1. First we need to add it to the database. Edit datamodel.graphql: + +```js +type Item { + id: ID! @unique + title: String! + description: String! + price: Int! +} +``` + +2. Now we need to either re-define it in our client-side schema, or import it carte blanche + +## The process for adding new queries or mutations |
