import { gql } from 'apollo-server'
export default gql`
type Query {
seePhoto(id: Int!): Photo
}
`
사진 id입력하면 사진을 return함.
import prisma from '../../client'
export default {
Query: {
seePhoto: (_, { id }) =>
prisma.photo.findUnique({
where: { id },
}),
},
}
check!!
Query는 async, await 가 사용되지 않음.
사진 1장 찾는 것.