update docs (#441)

* docs: update custom resolvers docs

* docs: update mono repo links
This commit is contained in:
Rikin Kachhia 2018-09-13 18:45:34 +05:30 committed by Shahidh K Muhammed
parent af6121f83d
commit d2decec32b
5 changed files with 17 additions and 14 deletions

View File

@ -117,7 +117,7 @@
</div>
<div class="footer-hasura-custom">
Want to contribute or report missing content? Check out the <a target="_blank" href="https://github.com/hasura/graphql-engine-docs">github repo for docs</a>.<br>
Want to contribute or report missing content? Check out the <a target="_blank" href="https://github.com/hasura/graphql-engine/tree/master/docs">github repo for docs</a>.<br>
Powered by <a target="_blank" href="http://www.sphinx-doc.org">Sphinx</a>.
Copyright &copy; 2018 <a target="_blank" href="https://hasura.io">Hasura</a>.
</div>

View File

@ -10,7 +10,7 @@ Here's a `notification demo app <https://shahidh.in/hasura-web-push-notifs/>`_ s
notifications using Hasura event triggers and FCM.
* Video: https://www.youtube.com/watch?v=nuSHkzE2-zo&feature=youtu.be
* Source code: https://github.com/shahidhk/hasura-web-push-notifs
* Source code: https://github.com/hasura/graphql-engine/tree/master/community/examples/serverless-push
Data Transformations (ETL)
^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -18,4 +18,4 @@ Here's a `serverless ETL demo app <https://shahidh.in/hasura-serverless-etl/>`_
Algolia search.
* Video: https://youtu.be/kWVEBWdEVAA
* Source code: https://github.com/shahidhk/hasura-serverless-etl
* Source code: https://github.com/hasura/graphql-engine/tree/master/community/examples/serverless-etl

View File

@ -18,7 +18,7 @@ Examples
You can find a bunch of examples for various serverless cloud providers in this repo:
https://github.com/hasura/cloud-functions-boilerplates
https://github.com/hasura/graphql-engine/tree/master/community/boilerplates/serverless-triggers
For example: update related data on a database event
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -28,7 +28,7 @@ note in a separate table.
You can find the complete example at:
https://github.com/hasura/cloud-functions-boilerplates/tree/master/aws-lambda/nodejs6/mutation-trigger.
https://github.com/hasura/graphql-engine/tree/master/community/boilerplates/serverless-triggers/aws-lambda/nodejs6/mutation.
Consider the following simplified schema for the above:

View File

@ -1,3 +1,4 @@
Adding custom GraphQL resolvers
===============================
@ -5,8 +6,8 @@ Hasura GraphQL engine provides instant GraphQL APIs over the tables and views of
auto-generating the CRUD resolvers. However, sometimes you might have to write custom resolvers to capture business
logic that is unrelated to the database.
We have setup `this boilerplate project <https://github.com/hasura/custom-resolvers-boilerplate>`_ illustrating how to
write your own custom GraphQL resolvers and merge them with the Hasura GraphQL engine's resolvers.
We have setup `this boilerplate project <https://github.com/hasura/graphql-engine/tree/master/community/boilerplates/custom-resolvers>`_
illustrating how to write your own custom GraphQL resolvers and merge them with the Hasura GraphQL engine's resolvers.
Follow the boilerplate's ``README.md`` for detailed instructions.
@ -14,10 +15,10 @@ TL;DR
-----
The boilerplate includes sample custom resolvers for:
- A ``hello`` query
- A ``count`` query (that returns a counter from another data source )
- A ``increment_counter`` mutation that increments the value of count
- A ``user_average_age`` query that makes directly makes an SQL query to Postgres using Knex
- A ``hello`` query which returns a fixed string.
- A ``count`` query that returns a counter from some other data source.
- A ``increment_counter`` mutation that increments the value of the above counter
- A ``user_average_age`` query that directly makes an SQL query to Postgres using Knex and returns the result
The steps to achieve this are:
@ -26,3 +27,5 @@ The steps to achieve this are:
- Make a new GraphQL schema out of these custom resolvers.
- Merge this schema with the existing Hasura GraphQL schema and serve the resulting GraphQL API.
The above steps are implemented using `Apollo's graphql-tools library <https://github.com/apollographql/graphql-tools>`__.

View File

@ -73,7 +73,7 @@ Now we can use the following subscription to fetch the latest location of a vehi
Check this `sample app <https://hasura.github.io/realtime-location-app/>`__ for a working demo
(`source code <https://github.com/hasura/realtime-location-app>`__).
(`source code <https://github.com/hasura/graphql-engine/tree/master/community/examples/realtime-location-tracking>`__).
.. _subscribe_table:
@ -149,7 +149,7 @@ Now we can use the following subscription to display the latest messages in a ch
}
Check this `sample app <https://chat-example-trial-roar.herokuapp.com/>`__ for a working demo
(`source code <https://github.com/wawhal/graphql-subscriptions-chat-app>`__).
(`source code <https://github.com/hasura/graphql-engine/tree/master/community/examples/realtime-chat>`__).
.. _subscribe_derived:
@ -281,4 +281,4 @@ Now we can use the following subscription to display the latest poll result:
}
Check this `sample app <https://shahidh.in/hasura-realtime-poll/>`__ for a working demo
(`source code <https://github.com/shahidhk/hasura-realtime-poll>`__).
(`source code <https://github.com/hasura/graphql-engine/tree/master/community/examples/realtime-poll>`__).