Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
derekjwilliams committed Mar 28, 2020
1 parent 446a70e commit 9e4008e
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
4 changes: 4 additions & 0 deletions data-services/html-source/mimi-server--structured/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This simple example performs the same functionality as the example found in ../mimi-server, but uses graphql-tools from Apollo

See https://www.apollographql.com/docs/graphql-tools/ for documentation

9 changes: 2 additions & 7 deletions data-services/html-source/mimi-server--structured/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const { ApolloServer, gql } = require('apollo-server');
const fetch = require('node-fetch');
const cheerio = require('cheerio');

import { makeExecutableSchema } from 'graphql-tools';

export const schema = makeExecutableSchema({
typeDefs,
resolverMap,
});
const { resolverMap } = require('./resolvers');
// const schema = require('schema');
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"apollo-server": "^2.11.0",
"cheerio": "^1.0.0-rc.3",
"graphql": "^14.6.0",
"graphql-tools": "^4.0.7",
"node-fetch": "^2.6.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const resolverMap = {
Query: {
collections: async(_, args) => {
return getCollections(args.kind)
}
},
}

export default resolverMap;
18 changes: 18 additions & 0 deletions data-services/html-source/mimi-server--structured/schema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { gql } = require('apollo-server');

const typeDefs = gql`
"Collection defines the queryable fields for every collection in mimi"
type Collection {
"The collection title"
title: String
href: String
backgroundImage: String
}
type Query {
"The collections query returns an array of zero or more Collections"
collections("What kind of collection, e.g. thesis" kind: String!): [Collection]
}
`

export default typeDefs;

0 comments on commit 9e4008e

Please sign in to comment.