graphile / crystal

🔮 Graphile's Crystal Monorepo; home to Grafast, PostGraphile, pg-introspection, pg-sql2 and much more!
https://graphile.org/
Other
12.55k stars 569 forks source link

forum example: how to use search operators #31

Closed mrbarletta closed 8 years ago

mrbarletta commented 8 years ago

thanks for the kool project! looks primising.

I was wondering how to use the search operators (e.g. like givenName: '%partOfName%')

Do we have to extend the exposed methods? is that even possible?

thanks!

calebmer commented 8 years ago

I haven't thought of a good way to represent complex operators in the GraphQL type system. However, I am planning to finish support for calling PostgreSQL procedures soon which would allow you to write custom functions to do this. You can actually see the branch implementing this feature here where I currently have mutative procedures implemented.

Relevant parts from that branch include this new example procedure and this passing test showing off procedures that perform mutations.

gilesbradshaw commented 8 years ago

have you any thoughts about how the existing graphql schema produced by postgraphql could be extended to add aditional parameters?

calebmer commented 8 years ago

Not too many yet. After the procedure stuff gets implemented and we have a good story for authentication, I want to work on the node API side to allow people to extend their schema however they want.

calebmer commented 8 years ago

@mrbarletta check out version 1.3.0-beta.0 and #41 and tell me how that works for you 👍

calebmer commented 8 years ago

Procedure support is released in 1.3.0. I wrote this new article with your issue in mind 😉

If it's inadequate in explaining the new feature, please tell me. Also you can follow #47 where simple free-form filtering using conditions will be possible.