OksenyukDmitro / MARKETROUND-backend

0 stars 0 forks source link

add custom JSON mocks to be returned by server #3

Open brmk opened 4 years ago

brmk commented 4 years ago
  const chats = [{
  _id: 'asdf',
  asdfadsf: 'asdf',
}]
const mocks = {
  Query: {
    getChats: () => chats
  }
};

new ApolloServer( {
  mocks
})
brmk commented 4 years ago

https://www.apollographql.com/docs/apollo-server/testing/mocking/