-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
446a70e
commit 9e4008e
Showing
5 changed files
with
33 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
data-services/html-source/mimi-server--structured/resolvers.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
18
data-services/html-source/mimi-server--structured/schema.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |