tendant / graphql-clj

A Clojure library that provides GraphQL implementation.
Eclipse Public License 1.0
285 stars 22 forks source link

Support for default argument values #11

Closed ku1ik closed 8 years ago

ku1ik commented 8 years ago

According to http://graphql.org/learn/schema/#arguments you can give arguments default values and then you can skip them in the query. I tried that but I'm getting {:error [{:message "Missing arguments: #{\"id\"}, for field (foo) in type (Query)."}]}. I briefly looked at the source and I don't see any code dealing with default values. What's the status of this? I may help with implementing this.

tendant commented 8 years ago

It hasn't been implemented yet. Pull requests are very welcome.

On Wednesday, October 5, 2016, Marcin Kulik notifications@github.com wrote:

According to http://graphql.org/learn/schema/#arguments you can give arguments default values and then you can skip them in the query. I tried that but I'm getting {:error [{:message "Missing arguments: #{\"id\"}, for field (foo) in type (Query)."}]}. I briefly looked at the source and I don't see any code dealing with default values. What's the status of this? I may help with implementing this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tendant/graphql-clj/issues/11, or mute the thread https://github.com/notifications/unsubscribe-auth/AACRPeEmUPn1_jMwphCYg8ArCgzm25azks5qw7clgaJpZM4KO5Ff .

tendant commented 8 years ago

Default argument value is supported now.

ku1ik commented 8 years ago

Awesome!

@tendant Btw, are there any simple tasks in the project I could help with? I'm not fully familiar with the codebase yet, but I'd like to help with moving it forward.

tendant commented 8 years ago

@sickill Thanks for your help on improving graphql-clj.

There are a few ways you can help.

  1. Try to use this library and file issue if you find something doesn't work.
  2. Help create test cases to cover the feature you want to use in graphql.
  3. Help create test cases from reference implementation: https://github.com/graphql/graphql-js.
  4. Current graphql-clj development progress is included in README.md, you can implement any unchecked items.
  5. Write some blog about how to use the library to help other users.

I will write some documentations about internal implementation of graphql-clj soon. Hopefully they will help you to understand the implementation detail.

Thanks, Lei

ku1ik commented 8 years ago

Thanks Lei.

I am doing exactly what you described - using the library and trying to improve it when I hit something not working. Some basic developer/implementation documentation would definitely help more people to contribute (that applies to any software project ;)), no rush though, the code is not hard to comprehend 👍 .