Skip to content

Commit

Permalink
Fix bug with manual query args
Browse files Browse the repository at this point in the history
  • Loading branch information
arackaf committed Dec 11, 2017
1 parent 00e1843 commit acc7045
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongo-graphql-starter",
"version": "0.4.4",
"version": "0.4.5",
"description": "",
"main": "index.js",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions src/codeGen/createTypeSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export default function createGraphqlTypeSchema(objectToCreate) {

Object.keys(fields).forEach(k => {
allQueryFields.push(...queriesForField(k, fields[k]));
if (Array.isArray(objectToCreate.manualQueryArgs)) {
allQueryFields.push(...objectToCreate.manualQueryArgs.map(arg => `${arg.name}: ${arg.type}`));
}
allFields.push(`${k}: ${displaySchemaValue(fields[k])}`);
allFieldsMutation.push(`${k}: ${displaySchemaValue(fields[k], true)}`);
});
if (Array.isArray(objectToCreate.manualQueryArgs)) {
allQueryFields.push(...objectToCreate.manualQueryArgs.map(arg => `${arg.name}: ${arg.type}`));
}

let dateFields = Object.keys(fields).filter(k => fields[k] === DateType || (typeof fields[k] === "object" && fields[k].__isDate));

Expand Down

0 comments on commit acc7045

Please sign in to comment.