-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update formatting for Simple Objects plugin documentation to match plugin expectations
- Loading branch information
1 parent
62c9be9
commit 8e10601
Showing
1 changed file
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ const ContactInfo = builder.simpleObject('ContactInfo', { | |
email: t.string({ | ||
nullable: false, | ||
}), | ||
phoneNUmber: t.string({ | ||
phoneNumber: t.string({ | ||
nullable: true, | ||
}), | ||
}), | ||
|
@@ -63,23 +63,26 @@ const Node = builder.simpleInterface('Node', { | |
}), | ||
}); | ||
|
||
const UserType = builder.simpleObject('User', { | ||
interfaces: [Node], | ||
fields: (t) => ({ | ||
firstName: t.string(), | ||
lastName: t.string(), | ||
contactInfo: t.field({ | ||
type: ContactInfo, | ||
nullable: false, | ||
const UserType = builder.simpleObject( | ||
'User', | ||
{ | ||
interfaces: [Node], | ||
fields: (t) => ({ | ||
firstName: t.string(), | ||
lastName: t.string(), | ||
contactInfo: t.field({ | ||
type: ContactInfo, | ||
nullable: false, | ||
}), | ||
}), | ||
}, | ||
// You can add additional fields with resolvers with a third fields argument | ||
(t) => ({ | ||
fullName: t.string({ | ||
resolve: (user) => `${user.firstName} ${user.lastName}`, | ||
}), | ||
}), | ||
}), | ||
// You can add aditional fields with resolvers with a third fields argument | ||
(t) => ({ | ||
fullName: t.string({ | ||
resolve: (user) => `${user.firstName} ${user.lastName}`, | ||
}), | ||
}) | ||
}); | ||
); | ||
|
||
builder.queryType({ | ||
fields: (t) => ({ | ||
|
@@ -95,7 +98,7 @@ builder.queryType({ | |
lastName: 'Organa', | ||
contactInfo: { | ||
email: '[email protected]', | ||
phoneNUmber: null, | ||
phoneNumber: null, | ||
}, | ||
}; | ||
}, | ||
|