Build Better GraphQL APIs: Thinking in Graphs
graphqlme.com
graphqlme.com
Do you have different experiences?
Business websites are different, usually with some important gated material behind an email signup but even then there is plenty of spam. Most marketing departments never bother to measure the bounce rate and attrition from these tactics so if all you look at are email signups, then of course it looks like it works.
There was an article that did it really well. I forget who it was but it was a good article about Mongo, about 1/2 - 2/3rds of the way through, it put a CTA and an email input box inline. It was obvious what it was, but didn't shove it in your face.
I thought I opened an article, not a newsletter subscription.
Who sane in their brain thinks this actually lead to new newsletter subscriptions? It's content hijacking.
They probably have metrics showing so. Otherwise they really are insane.
That's fine, to each his/her own. I'll stick with the 95% that ignore the prompt or (in my case) close the window when the screen blanks.
No, unfortunately it's shit. Not even a worked out full example.
https://blog.graph.cool/thinking-in-terms-of-graphs-a9087423... https://dev-blog.apollodata.com/the-concepts-of-graphql-bc68...
And a more full featured tutorial:
Full disclosure - I'm the co-founder of Graphcool.
That is to say I can only filter in ways the API developer thought of, specifically blessed.
Don’t get me wrong, it’s amazingly useful. A process that took us 40 seconds of back and forth with GitHub now takes less than one second.
One the one hand, you need to be flexible. On the other, allowing any query no matter how horrendous can be bad for a public API.
IMO, GraphQL strikes the perfect balance for a public API.
We also open-sourced the GraphQL compiler code that lets us write graph queries: https://github.com/kensho-technologies/graphql-compiler
pip install graphql-compilerIf graphql did require arbitrary filtering it would be useless to us at this point.
[0] https://github.com/apollographql/graphql-anywhere [1] https://github.com/apollographql/apollo-link-state
Ok. I've started to think in graphs. You know. Neo4J, Tinkerpop Gremlin, all that.
Oh, wait. How does that help me create that graph in a sane and meaningful way from a relational database and a number of microservices, especially if all the requests can be ad-hoc graph queries?
Ah, yes. The article (and all other articles on GraphQL) never answer that, do they?
It's quite an undertaking, increases the surface of bugs and attacks etc.
Check out our blog post: https://blog.kensho.com/compiled-graphql-as-a-database-query...
Open-sourced tool: https://github.com/kensho-technologies/graphql-compiler
pip install graphql-compiler