In this video Emmanuel Henri demonstrates how to make a list of items within a field so you can list multiple items inside a field, like a list.
- [Instructor] In many cases you will need to have…inside of a field, multiple values,…for example, a list of episodes a character…is featured in for a television show.…This is where you can create a type…and use the array characters to signify…a list of items inside the field.…In our case, we would like to implement a way…to list contacts for a friend.…Let's get to it.…So again, open the schema,…and inside of our type Friend here,…let's create a new field called contacts, like so.…
And then this contacts takes a list of contacts,…so you are making an array of a type Contact.…So we need to create that type.…So let's go ahead and create the type Contact,…which will basically have a first name,…which is a String, and then a last name,…which is also a String.…And let's make sure we also create an input,…so we can enter these contacts.…
So we need to create a contact input.…So just below the input here,…let's create a new one, ContactInput,…and again, same thing here.…So let's copy from line 16 to 17,…and let's paste these right there, very simple.…
- Basic GraphQL schema
- Object types and fields
- Role of the resolver in GraphQL
- Scalar and enumeration types
- Using GraphQL tools
- Setting up persistence
- Adding new items with mutations
- Updating and deleting items with mutations
- Queries with arguments, aliases, and fragments
Skill Level Intermediate
1. Setup and Introduction
2. Types and Schemas
3. Setting Up Persistence
5. Queries in Depth
Next steps1m 8s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.