Skip to content

Commit

Permalink
fix: Removing gql from web-demo
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Dec 3, 2019
1 parent 8db9286 commit c3676f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
26 changes: 1 addition & 25 deletions examples/expressjs/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as DIDComm from 'daf-did-comm'
import { SodiumFsEncryptionKeyManager } from 'daf-sodium-fs'

import { NodeSqlite3 } from 'daf-node-sqlite3'
import { DataStore, Gql as DataGql } from 'daf-data-store'
import { DataStore } from 'daf-data-store'
import ws from 'ws'

import Debug from 'debug'
Expand Down Expand Up @@ -89,27 +89,3 @@ export const core = new Daf.Core({

const db = new NodeSqlite3(dataStoreFilename)
export const dataStore = new DataStore(db)

const { ApolloServer } = require('apollo-server-express')
import merge from 'lodash.merge'

export const apolloServer = new ApolloServer({
typeDefs: [
Daf.Gql.baseTypeDefs,
Daf.Gql.Core.typeDefs,
Daf.Gql.IdentityManager.typeDefs,
DataGql.typeDefs,
DIDComm.Gql.typeDefs,
W3c.Gql.typeDefs,
],
resolvers: merge(
Daf.Gql.Core.resolvers,
Daf.Gql.IdentityManager.resolvers,
DataGql.resolvers,
DIDComm.Gql.resolvers,
W3c.Gql.resolvers,
),
context: () => ({ dataStore, core }),
introspection: true,
graphqlPath: '/graphql',
})
4 changes: 1 addition & 3 deletions examples/expressjs/src/web-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import exphbs from 'express-handlebars'
import sharedsession from 'express-socket.io-session'

const bodyParser = require('body-parser')
import { core, dataStore, apolloServer } from './setup'
import { core, dataStore } from './setup'
import { webDidDocFromEthrDid } from './web-did-doc'

import Debug from 'debug'
Expand Down Expand Up @@ -138,8 +138,6 @@ async function main() {
res.send('OK')
})

apolloServer.applyMiddleware({ app })

await dataStore.initialize()
const server = http.createServer(app)
const io = socketio(server)
Expand Down

0 comments on commit c3676f0

Please sign in to comment.