cult-of-coders / grapher

Grapher: Meteor Collection Joins + Reactive GraphQL like queries
https://atmospherejs.com/cultofcoders/grapher
MIT License
275 stars 53 forks source link

`getArgs` doesn't work for input types #434

Closed smeijer closed 4 years ago

smeijer commented 4 years ago
type Query {
  blog: Blog
}

type Blog {
  id: ID
  comments(where: FilterInput!): [Comment]
}

type Comment {
  id: ID
}

input FilterInput {
  author: String
}
query {
  blog {
    comments(where: { author: "smeijer" }) {
      body
    }
  }
}
db.blog.astToQuery(ast, {
  embody({ body, getArgs }) {
    // `args.where` is always undefined
    const args = getArgs('comments');
  }
});
theodorDiaconu commented 4 years ago

You get the args for path, why did you use security instead of getArgs(comments) ?

theodorDiaconu commented 4 years ago

Feel free to reopen this issue if that was the case.

smeijer commented 4 years ago

Sorry, that was an copy/paste error. The bug is real, I can't access input types. PR #435 fixes it though.