Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { noteMutations, noteQueries } from './note';
import { tagMutations, tagQueries } from './tag';

export default new GraphQLSchema({
query: userQueries,
// query: userQueries,
query: noteQueries,
mutation: collectionMutations
});
18 changes: 18 additions & 0 deletions src/app/note/queries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { GraphQLObjectType, GraphQLList } from 'graphql';
import NoteType from './types'
import Note from '../../database';

const noteQuery = new GraphQLObjectType({
name: 'Query',
fields: () => ({
notes: {
type: new GraphQLList(NoteType),
resolve: async(parentValue, args) => {
const note = await Note.find({});
return note;
}
}
})
})

export default noteQuery;