Initial commit
This commit is contained in:
commit
864f37a652
48 changed files with 45596 additions and 0 deletions
13
app/server/graphql/resolvers/bookOneResolver.ts
Normal file
13
app/server/graphql/resolvers/bookOneResolver.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { BookInput, Book } from "@generated/graphql";
|
||||
import { books } from "./booksManyResolver";
|
||||
|
||||
export async function BookOneResolver(
|
||||
_: any,
|
||||
{ ...input }: BookInput,
|
||||
): Promise<Book> {
|
||||
console.log("Called 'BookOneResolver' resolver...");
|
||||
|
||||
const book = books.filter((item) => item.id === input.id)[0];
|
||||
|
||||
return book;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue