Skip to content

Commit

Permalink
Export apongoDirectives rather than apongoDirective
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyarmes committed Feb 21, 2020
1 parent 14aff39 commit a56f535
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ when calling Apollo's `makeExecutableSchema`:

```
import { mergeTypes } from 'merge-graphql-schemas';
import { apongoDirective, apongoTypes } from 'apongo';
import { apongoDirectives, apongoTypes } from 'apongo';
...
const schema = makeExecutableSchema({
typeDefs: mergeTypes([apongoTypes, ...yourTypes]),
resolvers,
schemaDirectives: { apongo: apongoDirective },
schemaDirectives: { ...apongoDirectives },
});
```

Expand Down
4 changes: 2 additions & 2 deletions __tests__/apollo-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ApolloServer } from 'apollo-server';
import gql from 'graphql-tag';
import mongoose from 'mongoose';

import { apongoTypes, apongoDirective } from '../src/types';
import { apongoTypes, apongoDirectives } from '../src/types';
import createPipeline from '../src/create-pipeline';

const userSchema = new mongoose.Schema({
Expand Down Expand Up @@ -73,7 +73,7 @@ export const apolloServer = () => {
const server = new ApolloServer({
resolvers,
typeDefs: mergeTypes([apongoTypes, types]),
schemaDirectives: { apongo: apongoDirective }
schemaDirectives: { ...apongoDirectives }
});

const { query } = createTestClient(server);
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const createPipeline = require('./src/create-pipeline');
const { apongoTypes, apongoDirective } = require('./src/types');
const { apongoTypes, apongoDirectives } = require('./src/types');

module.exports = {
createPipeline,
apongoTypes,
apongoDirective,
apongoDirectives,
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apongo",
"version": "1.0.2",
"version": "1.1.0",
"description": "Create Mongo aggregation pipelines with recursive joins for Apollo queries.",
"main": "index.js",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ class apongoDirective extends SchemaDirectiveVisitor {

module.exports = {
apongoTypes,
apongoDirective,
apongoDirectives : { apongo: apongoDirective },
};

0 comments on commit a56f535

Please sign in to comment.