<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marion Schleifer</title>
    <description>The latest articles on DEV Community by Marion Schleifer (@marionschleifer).</description>
    <link>https://dev.to/marionschleifer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F143314%2F353bf10a-0a2d-4206-9cea-1330750e9454.jpeg</url>
      <title>DEV Community: Marion Schleifer</title>
      <link>https://dev.to/marionschleifer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marionschleifer"/>
    <language>en</language>
    <item>
      <title>OSS @Hasura: August Digest</title>
      <dc:creator>Marion Schleifer</dc:creator>
      <pubDate>Tue, 25 Aug 2020 08:23:50 +0000</pubDate>
      <link>https://dev.to/hasurahq/oss-hasura-august-digest-3432</link>
      <guid>https://dev.to/hasurahq/oss-hasura-august-digest-3432</guid>
      <description>&lt;h2&gt;
  
  
  OSS at Hasura
&lt;/h2&gt;

&lt;p&gt;At &lt;a href="https://hasura.io/"&gt;Hasura&lt;/a&gt; we 💜 open source contributions. We want to make the experience of contributing as smooth as possible. In our monthly digest we inform about issues that can be easily picked up and that will be especially beneficial for the Hasura community. We’re doing our best to make sure that all required information is provided, but should there be any issues, you can always reach out for help.&lt;/p&gt;

&lt;p&gt;This month, we have the following issues:&lt;/p&gt;

&lt;h3&gt;
  
  
  Hasura server (Haskell)
&lt;/h3&gt;

&lt;p&gt;We have recently changed our internal server architecture with our famous &lt;a href="https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/"&gt;PDV (Parse, don't validate) refactor&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;This &lt;a href="https://beta.usecodeflow.com/lexi-lambda/graphql-engine/c/pdv-execution-model"&gt;codeflow&lt;/a&gt; shows how GraphQL queries are executed in the PDV model. It might be a good resource to read before contributing to the Hasura server.&lt;/p&gt;

&lt;p&gt;As for server issues, we have the following open ones that are suitable for OSS contributions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/hasura/graphql-engine/issues/3806"&gt;Add tests for the &lt;code&gt;/explain&lt;/code&gt; API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/hasura/graphql-engine/issues/625"&gt;Add operators for Itree columns&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/hasura/graphql-engine/issues/3721"&gt;Add support for 3D geometries&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Setting up the dev environment for the server
&lt;/h4&gt;

&lt;p&gt;Check out the &lt;a href="https://github.com/hasura/graphql-engine/blob/master/server/CONTRIBUTING.md"&gt;contributing guide&lt;/a&gt; for information on how to set up the development environment for the Hasura server. &lt;/p&gt;

&lt;h3&gt;
  
  
  Hasura CLI (Go)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Add command to reset migrations
&lt;/h4&gt;

&lt;p&gt;We'd like to add a command that clears the history of the migrations on the server and clear the local migrations, as described in &lt;a href="https://github.com/hasura/graphql-engine/issues/5373"&gt;this issue&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you're interested in working on this issue, please comment on the issue. &lt;/p&gt;

&lt;h4&gt;
  
  
  Setting up the dev environment for the CLI
&lt;/h4&gt;

&lt;p&gt;Check out the &lt;a href="https://github.com/hasura/graphql-engine/blob/master/cli/CONTRIBUTING.md"&gt;contributing guide&lt;/a&gt; for information on how to set up the development environment for the Hasura CLI. &lt;/p&gt;

&lt;h3&gt;
  
  
  Hasura console (TypeScript &amp;amp; React)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Adding code snippets to GraphiQL code exporter
&lt;/h4&gt;

&lt;p&gt;We're very excited that we've already had some contributions to add code snippets to the GraphiQL code exporter.&lt;/p&gt;

&lt;p&gt;We'd like to add more code snippets, as described in &lt;a href="https://github.com/hasura/graphql-engine/issues/5263"&gt;this issue&lt;/a&gt;. Those code snippets can be in any language or frameworks. You can comment on the issue telling us in which language / framework you'd like to add a code snippet for, to avoid duplicate work.&lt;/p&gt;

&lt;h4&gt;
  
  
  Migrating from JavaScript to TypeScript
&lt;/h4&gt;

&lt;p&gt;We are so excited that so far we've had almost 40 PRs from the open source community that helped us migrating our &lt;a href="https://github.com/hasura/graphql-engine/tree/master/console"&gt;Hasura console&lt;/a&gt; from JavaScript to Typescript 🙏🏼&lt;/p&gt;

&lt;p&gt;There are still a lot of modules left to be migrated. If you're interested, check out &lt;a href="https://github.com/hasura/graphql-engine/issues/4314"&gt;this issue&lt;/a&gt;. If you'd like to work on a module or if you have any questions, please comment on the issue. &lt;/p&gt;

&lt;h4&gt;
  
  
  Setting up the dev environment for the console
&lt;/h4&gt;

&lt;p&gt;To find instructions about the local development setup, head to the &lt;a href="https://github.com/hasura/graphql-engine/tree/master/console"&gt;contributing guide for the Hasura console&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Learn tutorials
&lt;/h3&gt;

&lt;p&gt;You might be familiar with our &lt;a href="https://hasura.io/learn/"&gt;Hasura Learn Tutorials&lt;/a&gt;. We're looking for full-stack devs who can help us build our new JAMstack Learn series for the following frameworks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gatsby.js&lt;/li&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;Nuxt.js&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Writing quality tutorials is an elaborate task and we pay our contributors for it. If you're someone who likes writing tutorials and building web apps with any of the above frameworks, you can reach out to Praveen at &lt;a href="mailto:praveen@hasura.io"&gt;praveen@hasura.io&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Need help?
&lt;/h2&gt;

&lt;p&gt;If you have questions about contributing or if something is not clear, please comment on the issue you'd like to work on. Alternatively, you can join our &lt;a href="https://discord.com/invite/hasura"&gt;Discord channel&lt;/a&gt; and ask on the #contrib channel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Community call
&lt;/h2&gt;

&lt;p&gt;Join our community call on the 27th of August where we’ll talk about some of these issues in more detail. We’ll also announce some amazing new features, so don’t miss it! Check out the full agenda &lt;a href="https://hasura.io/community/community-call/"&gt;here&lt;/a&gt; and register for the call &lt;a href="https://us02web.zoom.us/meeting/register/tZAucuCvrTIrE9KdAkViZ7gHk7j58IOaJa0a"&gt;here&lt;/a&gt;. We hope to see you there! 🙌🏼&lt;/p&gt;

&lt;h2&gt;
  
  
  Previous digests
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/hasurahq/oss-hasura-july-digest-i5m"&gt;July&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/hasurahq/oss-hasura-may-digest-1dgj"&gt;May&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/hasurahq/oss-hasura-april-digest-48c7"&gt;April&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>hasura</category>
      <category>graphql</category>
      <category>opensource</category>
      <category>contributing</category>
    </item>
    <item>
      <title>OSS @Hasura: July Digest</title>
      <dc:creator>Marion Schleifer</dc:creator>
      <pubDate>Wed, 22 Jul 2020 16:44:33 +0000</pubDate>
      <link>https://dev.to/hasurahq/oss-hasura-july-digest-i5m</link>
      <guid>https://dev.to/hasurahq/oss-hasura-july-digest-i5m</guid>
      <description>&lt;p&gt;At &lt;a href="http://hasura.io/"&gt;Hasura&lt;/a&gt; we 💜 open source contributions. We want to make the experience of contributing as smooth as possible. In our monthly digest we inform about issues that can be easily picked up and that will be especially beneficial for the Hasura community. We’re doing our best to make sure that all required information is provided, but should there be any issues, you can always reach out for help. &lt;/p&gt;

&lt;p&gt;This month, we have the following issues:&lt;/p&gt;

&lt;h2&gt;
  
  
  Hasura CLI
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Add command to reset migrations
&lt;/h3&gt;

&lt;p&gt;We'd like to add a command that clears the history of the migrations on the server and clear the local migrations, as described in &lt;a href="https://github.com/hasura/graphql-engine/issues/5373"&gt;this issue&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you're interested in working on this issue, please comment on the issue. &lt;/p&gt;

&lt;p&gt;Check out the &lt;a href="https://github.com/hasura/graphql-engine/blob/master/cli/CONTRIBUTING.md"&gt;contributing guide&lt;/a&gt; for information on how to set up the development environment for the Hasura CLI. &lt;/p&gt;

&lt;h2&gt;
  
  
  Hasura Console
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Adding code snippets to GraphiQL code exporter
&lt;/h3&gt;

&lt;p&gt;We'd like to add more code snippets to the GraphiQL code exporter, as described in &lt;a href="https://github.com/hasura/graphql-engine/issues/5263"&gt;this issue&lt;/a&gt;. Those code snippets can be in any language or frameworks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Migrating from JavaScript to TypeScript
&lt;/h3&gt;

&lt;p&gt;We are so excited that so far we've had over 30 PRs from the open source community that helped us migrating our &lt;a href="https://github.com/hasura/graphql-engine/tree/master/console"&gt;Hasura console&lt;/a&gt; from JavaScript to Typescript 🙏🏼&lt;/p&gt;

&lt;p&gt;There are still a lot of modules left to be migrated. If you're interested, check out &lt;a href="https://github.com/hasura/graphql-engine/issues/4314"&gt;this issue&lt;/a&gt;. If you'd like to work on a module or if you have any questions, please comment on the issue. &lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up the dev environment for the console
&lt;/h3&gt;

&lt;p&gt;To find instructions about the local development setup, head to the &lt;a href="https://github.com/hasura/graphql-engine/tree/master/console"&gt;contributing guide for the Hasura console&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn tutorials
&lt;/h2&gt;

&lt;p&gt;You might be familiar with our &lt;a href="https://hasura.io/learn/"&gt;Hasura learn tutorials&lt;/a&gt;. We're looking to add a few courses around the JAMStack series:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gatsby.js&lt;/li&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;Nuxt.js&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since writing these tutorials are quite elaborate tasks, we'll pay the contributors. If you're interested, please get in touch with Praveen (&lt;a href="mailto:praveen@hasura.io"&gt;praveen@hasura.io&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Need help?
&lt;/h2&gt;

&lt;p&gt;If you have questions about contributing or if something is not clear, please comment on the issue you'd like to work on. Alternatively, you can join our &lt;a href="https://discord.com/invite/hasura"&gt;Discord channel&lt;/a&gt; and ask on the #contributing channel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Community call
&lt;/h2&gt;

&lt;p&gt;Join our community call on the 23rd of July where we’ll talk about some of these issues in more detail. We’ll also announce some amazing new features, so don’t miss it! Check out the full agenda &lt;a href="https://hasura.io/community/community-call/"&gt;here&lt;/a&gt; and register for the call &lt;a href="https://us02web.zoom.us/webinar/register/WN_v2C0q7EGQFeDmusHBJeWWQ"&gt;here&lt;/a&gt;. We hope to see you there! 🙌🏼&lt;/p&gt;

&lt;h2&gt;
  
  
  Previous digests
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/hasurahq/oss-hasura-april-digest-48c7"&gt;April&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/hasurahq/oss-hasura-may-digest-1dgj"&gt;May&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>hasura</category>
      <category>graphql</category>
      <category>opensource</category>
      <category>contributing</category>
    </item>
    <item>
      <title>OSS @Hasura: May Digest</title>
      <dc:creator>Marion Schleifer</dc:creator>
      <pubDate>Mon, 25 May 2020 14:18:49 +0000</pubDate>
      <link>https://dev.to/hasurahq/oss-hasura-may-digest-1dgj</link>
      <guid>https://dev.to/hasurahq/oss-hasura-may-digest-1dgj</guid>
      <description>&lt;p&gt;At &lt;a href="http://hasura.io/"&gt;Hasura&lt;/a&gt; we 💜 open source contributions. We want to make the experience of contributing as smooth as possible. In our monthly digest we inform about issues that can be easily picked up and that will be especially beneficial for the Hasura community. We’re doing our best to make sure that all required information is provided, but should there be any issues, you can always reach out for help. &lt;/p&gt;

&lt;p&gt;This month, we have the following issues:&lt;/p&gt;

&lt;h2&gt;
  
  
  Migrating from JavaScript to TypeScript
&lt;/h2&gt;

&lt;p&gt;We are so excited that so far we've had over 30 PRs from the open source community that helped us migrating our &lt;a href="https://github.com/hasura/graphql-engine/tree/master/console"&gt;Hasura console&lt;/a&gt; from JavaScript to Typescript 🙏🏼&lt;/p&gt;

&lt;p&gt;There are still a lot of modules left to be migrated. If you're interested, check out &lt;a href="https://github.com/hasura/graphql-engine/issues/4314"&gt;this issue&lt;/a&gt;. If you'd like to work on a module or if you have any questions, please comment on the issue. To find instructions about the local development setup, head to the &lt;a href="https://github.com/hasura/graphql-engine/tree/master/console"&gt;contributing guide for the Hasura console&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Actions codegen
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://hasura.io/docs/1.0/graphql/manual/actions/index.html"&gt;Actions&lt;/a&gt; are a way of extending your GraphQL schema with custom business logic using custom queries and mutations.&lt;/p&gt;

&lt;p&gt;We keep adding new codegens for actions. So far, we have codegen for the following frameworks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;nodejs-express&lt;/li&gt;
&lt;li&gt;nodejs-zeit&lt;/li&gt;
&lt;li&gt;typescript-zeit&lt;/li&gt;
&lt;li&gt;nodejs-Azure-function&lt;/li&gt;
&lt;li&gt;go-serve-mux&lt;/li&gt;
&lt;li&gt;javascript-js-doc-express&lt;/li&gt;
&lt;li&gt;kotlin-http4k&lt;/li&gt;
&lt;li&gt;kotlin-ktor&lt;/li&gt;
&lt;li&gt;python-fast-api&lt;/li&gt;
&lt;li&gt;python-flask&lt;/li&gt;
&lt;li&gt;ruby-rails&lt;/li&gt;
&lt;li&gt;typescript-express&lt;/li&gt;
&lt;li&gt;java-spring-boot&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We want to have codegen for all the frameworks out there and we'd love your help in adding more! 🔥&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/hasura/graphql-engine/issues/4578"&gt;This issue&lt;/a&gt; lists frameworks that we're particularly interested in. In &lt;a href="https://github.com/hasura/codegen-assets/blob/master/builder-kit/README.md"&gt;this README&lt;/a&gt; you can find detailed instructions on how to contribute to Hasura codegen.&lt;/p&gt;

&lt;p&gt;If you'd like to implement one of these, please comment on the issue so that we and everyone else knows what frameworks are currently being worked on.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Server contributions
&lt;/h2&gt;

&lt;p&gt;If you're excited about Haskell contributions, we have a few open &lt;a href="https://github.com/hasura/graphql-engine/issues?q=is%3Aopen+is%3Aissue+label%3Ac%2Fserver+label%3A%22help+wanted%22"&gt;Hasura server issues&lt;/a&gt;. To get an overview of the Hasura server architecture, check out &lt;a href="https://github.com/hasura/graphql-engine/wiki/Server-code-architecture"&gt;this guide&lt;/a&gt;. If you want to work on an issue, please comment on the issue. We are particularly excited about any Haskell contributions! 🙌🏼&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn tutorials
&lt;/h2&gt;

&lt;p&gt;We continuously add to our &lt;a href="https://hasura.io/learn/"&gt;Learn tutorials&lt;/a&gt;. Currently we have the following groups of tutorials:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Introduction to GraphQL&lt;/li&gt;
&lt;li&gt;Hasura Backend tutorial&lt;/li&gt;
&lt;li&gt;Frontend tutorials&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are a few tasks that we'd love to have your help with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/hasura/learn-graphql/issues/214"&gt;Updating &lt;code&gt;graphql-flutter&lt;/code&gt; package to v3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/hasura/learn-graphql/issues/190"&gt;Update React tutorial to support apollo client v3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/hasura/learn-graphql/issues/189"&gt;Upgrade Vue to v3 in &lt;code&gt;vue-apollo&lt;/code&gt; tutorial&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're interested in working on one of these, please comment on the respective issue. Questions are also welcome :)&lt;/p&gt;

&lt;h2&gt;
  
  
  Need help?
&lt;/h2&gt;

&lt;p&gt;If you have questions about contributing or if something is not clear, please comment on the issue you'd like to work on. Alternatively, you can join our &lt;a href="https://discord.com/invite/hasura"&gt;Discord channel&lt;/a&gt; and ask on the #contributing channel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Community call
&lt;/h2&gt;

&lt;p&gt;Join our community call on the 27th of May where we’ll talk about some of these issues in more detail. We’ll also announce some amazing new features, so don’t miss it! Check out the full agenda &lt;a href="https://hasura.io/community/community-call/"&gt;here&lt;/a&gt; and register for the call &lt;a href="https://us02web.zoom.us/meeting/register/tJAld-2grDgvH9CLqk8EgAlWW6bIENra4QcR"&gt;here&lt;/a&gt;. We hope to see you there! 🙌🏼&lt;/p&gt;

</description>
      <category>hasura</category>
      <category>graphql</category>
      <category>opensource</category>
      <category>contributing</category>
    </item>
    <item>
      <title>OSS @Hasura: April Digest</title>
      <dc:creator>Marion Schleifer</dc:creator>
      <pubDate>Mon, 27 Apr 2020 18:24:56 +0000</pubDate>
      <link>https://dev.to/hasurahq/oss-hasura-april-digest-48c7</link>
      <guid>https://dev.to/hasurahq/oss-hasura-april-digest-48c7</guid>
      <description>&lt;p&gt;At &lt;a href="http://hasura.io/"&gt;Hasura&lt;/a&gt; we 💜 open source contributions. We want to make the experience of contributing as smooth as possible. Therefore, we’re publishing a monthly digest with issues that can be easily picked up and that will be especially beneficial for the Hasura community. We’re doing our best to make sure that all required information is provided, but should there be any issues, you can always reach out for help. &lt;/p&gt;

&lt;p&gt;This month, we have the following issues:&lt;/p&gt;

&lt;h3&gt;
  
  
  Migrating from JavaScript to TypeScript
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Component: Console&lt;/li&gt;
&lt;li&gt;Languages: JavaScript / TypeScript&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/hasura/graphql-engine/issues/4314"&gt;GitHub issue&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We’ve recently started migrating from JavaScript to TypeScript. We’d love for you to help us with this migration. In &lt;a href="https://github.com/hasura/graphql-engine/issues/4314"&gt;the issue&lt;/a&gt;, you can expand the following section to see the specific modules you can work on:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8YHSEG7v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9z9dpm1sfwdkoo1qwn6u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8YHSEG7v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9z9dpm1sfwdkoo1qwn6u.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please see our &lt;a href="https://github.com/hasura/graphql-engine/tree/master/console"&gt;README&lt;/a&gt; for the Hasura console to get your development environment set up.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hasura actions
&lt;/h3&gt;

&lt;p&gt;We’ve recently launched Hasura actions. Actions are a way of extending the Hasura schema with custom business logic. Actions can be used for a variety of use cases, such as data validation, data enrichment and any other type of complex business logic. You can find more details and examples in the &lt;a href="https://hasura.io/docs/1.0/graphql/manual/actions/index.html"&gt;documentation&lt;/a&gt;. Also, we have a &lt;a href="https://www.youtube.com/watch?reload=9&amp;amp;v=0sYJxmfy7wA&amp;amp;t=1s"&gt;demo video&lt;/a&gt; showcasing actions in action :)&lt;/p&gt;

&lt;h4&gt;
  
  
  Actions codegen
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Component: Community&lt;/li&gt;
&lt;li&gt;Language: Open&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/hasura/graphql-engine/issues/4578"&gt;GitHub issue&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hasura actions come with &lt;a href="https://hasura.io/docs/1.0/graphql/manual/actions/codegen.html"&gt;codegen&lt;/a&gt; that allows you to create actions more easily. We already have codegen for &lt;a href="https://github.com/hasura/codegen-assets/tree/master/nodejs-express"&gt;nodejs-express&lt;/a&gt;, &lt;a href="https://github.com/hasura/codegen-assets/tree/master/nodejs-zeit"&gt;nodejs-zeit&lt;/a&gt; and many more. All existing codegens can be found in &lt;a href="https://github.com/hasura/codegen-assets"&gt;this repository&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Currently open programming languages / frameworks are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;nodejs-lamda&lt;/li&gt;
&lt;li&gt;nodejs-azure-function&lt;/li&gt;
&lt;li&gt;nodejs-gcf&lt;/li&gt;
&lt;li&gt;typescript-azure&lt;/li&gt;
&lt;li&gt;python3-lambda&lt;/li&gt;
&lt;li&gt;python3-azure&lt;/li&gt;
&lt;li&gt;python3-gcf&lt;/li&gt;
&lt;li&gt;python3-django&lt;/li&gt;
&lt;li&gt;ruby-lambda&lt;/li&gt;
&lt;li&gt;ruby-rails&lt;/li&gt;
&lt;li&gt;ruby-sinatra&lt;/li&gt;
&lt;li&gt;java8-azure&lt;/li&gt;
&lt;li&gt;java8-lambda&lt;/li&gt;
&lt;li&gt;golang-lambda&lt;/li&gt;
&lt;li&gt;golang-gcf&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’d like to work on one of these, just comment on &lt;a href="https://github.com/hasura/graphql-engine/issues/4578"&gt;the issue&lt;/a&gt; and let us know. Also, if you need help with the setup, get in touch and we’ll be happy to jump on a call.&lt;/p&gt;

&lt;p&gt;If you’d like to contribute with a programming language or framework that is not on the list, that’s totally fine! Just comment on the issue, so that others know what you’re working on. :)&lt;/p&gt;

&lt;h4&gt;
  
  
  Actions examples
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Component: Community&lt;/li&gt;
&lt;li&gt;Language: Open&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/hasura/hasura-actions-examples/issues/13"&gt;GitHub issue 1&lt;/a&gt;, &lt;a href="https://github.com/hasura/hasura-actions-examples/issues/5"&gt;GitHub issue 2&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We have a &lt;a href="https://github.com/hasura/hasura-actions-examples"&gt;GitHub repository&lt;/a&gt; with various use cases and examples on how to use actions. And we’re looking for some more of those, specifically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/hasura/hasura-actions-examples/issues/13"&gt;Auth action in python flask&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/hasura/hasura-actions-examples/issues/5"&gt;Send email action with Amazon SES&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you can think of an action example that we haven’t covered yet, feel free to go ahead and open a pull request. We’re happy about any contributions!&lt;/p&gt;

&lt;h3&gt;
  
  
  More issues
&lt;/h3&gt;

&lt;p&gt;Didn’t find what you were looking for? If you would like to check out more issues, feel free to browse &lt;a href="https://github.com/hasura/graphql-engine/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+"&gt;the list here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Need help?
&lt;/h3&gt;

&lt;p&gt;If something is not clear or you need help with something, please comment on the issue you’d like to work on or join our &lt;a href="https://discordapp.com/invite/hasura"&gt;Discord server&lt;/a&gt; (post in the #contrib channel). The community and the team will be happy to help out. &lt;/p&gt;

&lt;h3&gt;
  
  
  Community call
&lt;/h3&gt;

&lt;p&gt;Join our community call on the 29th of April where we’ll talk about some of these issues in more detail - especially actions codegen. We’ll also announce some amazing new features, so don’t miss it! Check out the full agenda &lt;a href="https://hasura.io/community/community-call/"&gt;here&lt;/a&gt; and register for the call &lt;a href="https://zoom.us/meeting/register/vJMpde-rqzwtnLTqR9eRj39prUTBmfyv6w"&gt;here&lt;/a&gt;. We hope to see you there! 🙌🏼&lt;/p&gt;

</description>
      <category>hasura</category>
      <category>graphql</category>
      <category>opensource</category>
      <category>contributing</category>
    </item>
    <item>
      <title>GraphQL &amp; serverless Ruby</title>
      <dc:creator>Marion Schleifer</dc:creator>
      <pubDate>Mon, 03 Jun 2019 13:25:18 +0000</pubDate>
      <link>https://dev.to/marionschleifer/graphql-serverless-ruby-348p</link>
      <guid>https://dev.to/marionschleifer/graphql-serverless-ruby-348p</guid>
      <description>&lt;p&gt;As GraphQL and serverless are becoming more popular, we will check out how to build such an application with serverless Ruby. The option proposed in this post is to use a simple GraphQL backend with a modern frontend framework (e.g. Vue or React) and use serverless Ruby to add custom business logic.&lt;/p&gt;

&lt;h4&gt;
  
  
  Table of Contents
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/25cac1e09dec#f470"&gt;3factor app architecture&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/25cac1e09dec#72b5"&gt;Serverless functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/25cac1e09dec#6812"&gt;No infrastructure management&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/25cac1e09dec#26f0"&gt;Cost efficiency&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/25cac1e09dec#ecfb"&gt;Reliability&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/25cac1e09dec#b45c"&gt;Cloud providers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/25cac1e09dec#cb30"&gt;Our task&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/25cac1e09dec#a0f7"&gt;Creating our first serverless function&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/25cac1e09dec#f119"&gt;Adding an event trigger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/25cac1e09dec#5184"&gt;Let’s test this!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/25cac1e09dec#6df5"&gt;Remote schemas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/25cac1e09dec#ed2a"&gt;Join the community&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3factor app architecture
&lt;/h3&gt;

&lt;p&gt;The proposed architecture in this blogpost is to use the 3factor app architecture (&lt;a href="https://3factor.app/"&gt;https://3factor.app/&lt;/a&gt;). We use Hasura for the realtime GraphQL and reliable eventing, and AWS lambdas for async serverless. To set up your GraphQL backend, read this tutorial: &lt;a href="https://dev.to/marionschleifer/beginners-guide-to-graphql-api-8ke"&gt;https://medium.com/@marion.schleifer/beginners-guide-to-graphql-api-d5ec68c69f69&lt;/a&gt;. In this post, we will focus on how to add serverless business logic on AWS using Ruby. The frontend integration is not covered in this, but you can read up on it here: &lt;a href="https://medium.com/@marion.schleifer/how-to-connect-your-graphql-api-to-your-vuejs-frontend-61d8e8e455db"&gt;https://medium.com/@marion.schleifer/how-to-connect-your-graphql-api-to-your-vuejs-frontend-61d8e8e455db&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Serverless functions
&lt;/h3&gt;

&lt;p&gt;Serverless functions is code that runs in the cloud. We will use them together with Hasura event triggers. In the Hasura project, we can add event triggers that invoke a serverless function after a mutation (insert, update, delete). This can for example be used to do things like sending an email, adding a payment API or processing async business logic. With a serverless architecture, we get the following advantages:&lt;/p&gt;

&lt;h4&gt;
  
  
  No infrastructure management
&lt;/h4&gt;

&lt;p&gt;If you run your code in the cloud, the responsibility for maintenance relies with the cloud provider which allows you to focus on the frontend without worrying about maintaining a server.&lt;/p&gt;

&lt;h4&gt;
  
  
  Cost efficiency
&lt;/h4&gt;

&lt;p&gt;With all modern cloud providers, you can start for free. When you start to get more traffic, the costs are designed to scale. This means that you pay based on how many times your serverless functions are triggered.&lt;/p&gt;

&lt;h4&gt;
  
  
  Reliability
&lt;/h4&gt;

&lt;p&gt;You can count on the cloud providers to make sure there are no (or only very short) down times. The common cloud providers are huge corporations that have built a gigantic infrastructure around their cloud services, and they ensure uptime.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cloud providers
&lt;/h3&gt;

&lt;p&gt;You can deploy your serverless functions to any cloud provider. Those that are most commonly used in combination with Hasura are the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Glitch (simple, free, only JavaScript, best for prototyping)&lt;/li&gt;
&lt;li&gt;Google Cloud (Google, cost at scale, several languages)&lt;/li&gt;
&lt;li&gt;Azure (Microsoft, cost at scale, several languages)&lt;/li&gt;
&lt;li&gt;AWS (Amazon, cost at scale, several languages including Ruby)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Our task
&lt;/h3&gt;

&lt;p&gt;In our Harry Potter API (&lt;a href="https://dev.to/marionschleifer/beginners-guide-to-graphql-api-8ke"&gt;https://medium.com/@marion.schleifer/beginners-guide-to-graphql-api-d5ec68c69f69&lt;/a&gt;), we have a movies table. We now want to write a serverless function that gets triggered when a new movie is inserted. All this function will do is send the title and the release date back to the server where we will inspect it. Let’s go ahead and get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating our first serverless function
&lt;/h3&gt;

&lt;p&gt;As AWS is the only cloud provider that supports Ruby at this time, we’ll go with this one, because we all love Ruby, right? First, create an account on AWS if you don’t already have one. The first year will be free, so you don’t have to worry about costs, as long as you don’t have a huge amount of traffic on your functions.&lt;/p&gt;

&lt;p&gt;After logging in, go to the AWS Management Console and click on “Lambda”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IPcecwnd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AcwXhCb3Sb9SNxcGP" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IPcecwnd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AcwXhCb3Sb9SNxcGP" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now click on the button to create a new function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TWRJjwUY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AAzJBgT_4H4pTfG1w" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TWRJjwUY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AAzJBgT_4H4pTfG1w" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we don’t have blueprints or existing repositories yet, we will author our function from scratch. Below, you can enter your function name (no spaces and small letters). We will call our function “movie_inserted” because we want it to be triggered whenever a new movie is inserted. As for the runtime, there is one Ruby version to choose from, and we will select “Ruby 2.5”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VAMzpWAN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AOez8H5jtiW5YeXqw" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VAMzpWAN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AOez8H5jtiW5YeXqw" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now click on the button “Create function”. As you can see on the next page, our function was created:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--51xTxTP2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A7gi3aruRL50scItp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--51xTxTP2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A7gi3aruRL50scItp" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you scroll down, you can see the definition for our first AWS function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QBGG9579--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AI_42h7LeB9A8x07y" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QBGG9579--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AI_42h7LeB9A8x07y" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Inside the function, we want to read the movie information out of the event that is passed to the function. Then, we want to send the title and the release date from the newly inserted movie back to the server.&lt;/p&gt;

&lt;p&gt;Let’s change the function to the following:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;On the top right side, click the Save button.&lt;/p&gt;

&lt;p&gt;Now we have a function, but we need to have an endpoint that can be called for the function to run. Let’s add an API Gateway:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vR84GYq---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AskaAEcZcjBkoaRvG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vR84GYq---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AskaAEcZcjBkoaRvG" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we scroll down, we can configure our trigger:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Netif4wj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AD0q11JMfgCfRVSpe" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Netif4wj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AD0q11JMfgCfRVSpe" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will create a new API because we don’t have any existing ones yet. And we’ll have an open endpoint. In a real life project, you would have stronger authentication, for example with an access token. But we’ll keep it simple for now. When you added the trigger, you can save it on the top right corner.&lt;/p&gt;

&lt;p&gt;Once saved, you can see that an endpoint for the function invocation will be provided. Let’s copy this URL to the clipboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--epbE8Qhk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Agu3czongdOxqQ90b" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--epbE8Qhk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Agu3czongdOxqQ90b" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Adding an event trigger
&lt;/h4&gt;

&lt;p&gt;Now it’s time to add an event trigger in our Hasura project that will be invoked whenever we insert a new movie. Open your API with the Hasura console and click on “Events” in the menu. On this page you find links to the documentation for serverless functions with different cloud providers that work with Hasura.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1G4VKulD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Ac6jYfcwpyucsE-3T" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1G4VKulD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Ac6jYfcwpyucsE-3T" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we’ll add all the trigger information. Our trigger name is “movie_inserted”, like on AWS. The table is public and our database table that we want to trigger is the movies table. Also, we want the trigger to go off only when a new movie is inserted. Under “Webhook URL”, we paste the URL that we copied before on AWS. When we have all that, we can click on “Add Event Trigger”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SGa62Uk7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AuNfEdgC4LaMymNe0" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SGa62Uk7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AuNfEdgC4LaMymNe0" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Let’s test this!
&lt;/h4&gt;

&lt;p&gt;Now we want to test if this all works. In the Hasura console, let’s add a new movie.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vqzAgvkH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A4WA-bbA7i5jMNr42" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vqzAgvkH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A4WA-bbA7i5jMNr42" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we now click on “Events”, we see that it worked:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AUpizZUG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AzFP9VUPriAnmMLjJ" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AUpizZUG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AzFP9VUPriAnmMLjJ" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can now expand the event and see under “Request” what is sent from Hasura to our cloud function. From there, we know the structure of the event and how to read out the information in the previous part. Under “Response”, we can see what is actually sent back to the server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--odAI7uSH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Atq54T8aFl7HVqGED" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--odAI7uSH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Atq54T8aFl7HVqGED" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see, it’s exactly the title and the release date from the movie that we just created. So the function works. Good job!&lt;/p&gt;

&lt;h3&gt;
  
  
  Remote schemas
&lt;/h3&gt;

&lt;p&gt;Maybe you have an existing GraphQL API / service and you want to use a Hasura project on top of it. No problem! Hasura has you covered. It has the ability to merge remote GraphQL schemas and provide a unified GraphQL API. You can write new custom GraphQL resolvers in any language which can then be merged into Hasura. All you need to do is provide an API endpoint to Hasura to stitch the two GraphQL services together. This allows you to make all your API calls from one point. Let’s check out how to do this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6yElUhCo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2ABvPTqjDbA_N2XJK9" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6yElUhCo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2ABvPTqjDbA_N2XJK9" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the “Remote Schemas” tab, click on “Add” to add your existing GraphQL service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nG_GGGcW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AegRB30Gfb2ZZsojM" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nG_GGGcW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AegRB30Gfb2ZZsojM" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Enter the name of your remote schema.&lt;/li&gt;
&lt;li&gt;Insert the URL, so that you can access your Hasura API from your linked GraphQL service.&lt;/li&gt;
&lt;li&gt;If you have additional headers (e.g. for authorization), you can insert them here.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When you are done, you can make requests to your remote server from your Hasura GraphQL API.&lt;/p&gt;

&lt;p&gt;For more documentation on serverless functions, event triggers and remote schemas, read more on the Hasura documentation page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://hasura.io/event-triggers"&gt;Trigger webhooks on database events | Hasura GraphQL Engine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.hasura.io/1.0/graphql/manual/event-triggers/index.html"&gt;https://docs.hasura.io/1.0/graphql/manual/event-triggers/index.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.hasura.io/1.0/graphql/manual/remote-schemas/index.html"&gt;Remote schemas | Hasura 1.0 documentation&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Join the community
&lt;/h3&gt;

&lt;p&gt;Hasura is being used by a growing number of developers. Join the friendly community and keep up with updates.&lt;/p&gt;

&lt;p&gt;If you want to start building your own projects with Hasura, you can join their discord channel here: &lt;a href="https://discordapp.com/invite/hasura"&gt;https://discordapp.com/invite/hasura&lt;/a&gt;. There is already a pretty large community and you will get help very quickly.&lt;/p&gt;

&lt;p&gt;🐦 Twitter: &lt;a href="https://twitter.com/hasurahq"&gt;https://twitter.com/hasurahq&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;⭐️ Github: &lt;a href="https://github.com/hasura/graphql-engine"&gt;https://github.com/hasura/graphql-engine&lt;/a&gt;&lt;/p&gt;

</description>
      <category>graphql</category>
      <category>serverless</category>
      <category>awslambda</category>
      <category>ruby</category>
    </item>
    <item>
      <title>Beginner’s Guide to GraphQL API</title>
      <dc:creator>Marion Schleifer</dc:creator>
      <pubDate>Fri, 08 Mar 2019 09:14:10 +0000</pubDate>
      <link>https://dev.to/marionschleifer/beginners-guide-to-graphql-api-8ke</link>
      <guid>https://dev.to/marionschleifer/beginners-guide-to-graphql-api-8ke</guid>
      <description>&lt;p&gt;Today, I want to show you how to build serverless backends with the Hasura GraphQL API. After looking at GraphQL and its advantages, we will learn how to create new tables for our API. Next, we want to fill our database with real data. Of course, we want to have relationships between our tables. Finally, we will learn how to manipulate the data using mutations. No previous knowledge of GraphQL is required to follow this tutorial.&lt;/p&gt;

&lt;h4&gt;
  
  
  Table of Contents
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/d5ec68c69f69#b95a" rel="noopener noreferrer"&gt;About GraphQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/d5ec68c69f69#8d2f" rel="noopener noreferrer"&gt;About Hasura&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/d5ec68c69f69#68aa" rel="noopener noreferrer"&gt;Creating a project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/d5ec68c69f69#a0f0" rel="noopener noreferrer"&gt;Create tables&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/d5ec68c69f69#7ffe" rel="noopener noreferrer"&gt;Insert data&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/d5ec68c69f69#55cb" rel="noopener noreferrer"&gt;Queries&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/d5ec68c69f69#bd0c" rel="noopener noreferrer"&gt;Relationships&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/d5ec68c69f69#da90" rel="noopener noreferrer"&gt;Object relationship&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/d5ec68c69f69#ae14" rel="noopener noreferrer"&gt;Array relationship&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/d5ec68c69f69#905a" rel="noopener noreferrer"&gt;Many-to-many relationship&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/d5ec68c69f69#857c" rel="noopener noreferrer"&gt;Mutations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/p/d5ec68c69f69#c25c" rel="noopener noreferrer"&gt;Join the community&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  About GraphQL
&lt;/h3&gt;

&lt;p&gt;GraphQL is a typed query language for APIs. More and more tech companies, including tech giants like Facebook, Twitter and GitHub, are switching from common REST apis to GraphQL solutions. The main advantages of GraphQL over other API architectures like REST are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get the exact data you need with easily understandable queries&lt;/li&gt;
&lt;li&gt;Get reliable results and helpful error messages&lt;/li&gt;
&lt;li&gt;Fast and lightweight applications because the data is accessed directly instead of through a server&lt;/li&gt;
&lt;li&gt;Get several resources with one query without using several URLs and chaining resources&lt;/li&gt;
&lt;li&gt;Use one endpoint for all data and typed fields for correct data access&lt;/li&gt;
&lt;li&gt;Add GraphQL easily to your existing applications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is a sample query:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;And its corresponding result:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;As you can see, the query is very intuitive and the result is predictable. You get exactly what you ask for: not more and not less.&lt;/p&gt;

&lt;p&gt;As web applications tend to get more complex, there is a growing need for fast and easily maintainable solutions. So this is probably a good time to have a glimpse at GraphQL. But how do we use it? Do I need to build my own server? How can we connect it to our frontend? Don’t worry, we’ll get there.&lt;/p&gt;

&lt;h3&gt;
  
  
  About Hasura
&lt;/h3&gt;

&lt;p&gt;Hasura provides you with an &lt;strong&gt;open source&lt;/strong&gt; GraphQL engine that runs in a Docker container. Hasura connects to the Postgres database that is created with the project. You can also run Hasura GraphQL on top of an existing project. This can in particular be useful if you want to migrate to GraphQL, as it allows you to do the migration in smaller steps.&lt;/p&gt;

&lt;p&gt;There are several options as to where you can deploy your GraphQL API: Heroku, Docker, Digital Ocean, Azure, AWS and Google Cloud.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a project
&lt;/h3&gt;

&lt;p&gt;In this post, we will get started with Heroku. We are going to create a Harry Potter api 🤓&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dashboard.heroku.com/new?button-url=https%3A%2F%2Fdocs.hasura.io%2F1.0%2Fgraphql%2Fmanual%2Fgetting-started%2Fheroku-simple.html&amp;amp;template=https%3A%2F%2Fgithub.com%2Fhasura%2Fgraphql-engine-heroku" rel="noopener noreferrer"&gt;https://dashboard.heroku.com/new?button-url=https%3A%2F%2Fdocs.hasura.io%2F1.0%2Fgraphql%2Fmanual%2Fgetting-started%2Fheroku-simple.html&amp;amp;template=https%3A%2F%2Fgithub.com%2Fhasura%2Fgraphql-engine-heroku&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the dashboard, choose a (unique) name for your api and click the “Deploy” button:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2APzGCLtqmgTBDy7yNobtDcA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2APzGCLtqmgTBDy7yNobtDcA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That was easy, right? Now, if you scroll to the bottom you will see this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Aq_ZSZUZ4SXHu-Xuoj-Wpig.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Aq_ZSZUZ4SXHu-Xuoj-Wpig.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you click on “View”, the Hasura console will open in the GraphiQL tool, which is also one of the features that makes your life with GraphQL super easy. In the Hasura console, you can create tables and test queries. Let’s have a quick look at the console:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AYaRd-TK6aig7EONxAgeoSg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AYaRd-TK6aig7EONxAgeoSg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;This is the (only) endpoint used to interact with the api. When we later poll data from external services, this is the URL we need to access. And yes, you’ve seen correctly: requests to GraphQL are always POST requests.&lt;/li&gt;
&lt;li&gt;Here, you can add request headers. If you want to add authentication (e.g. with JWT tokens) later, you can add the headers here.&lt;/li&gt;
&lt;li&gt;This is the field where you can test queries.&lt;/li&gt;
&lt;li&gt;Here, the results will be displayed.&lt;/li&gt;
&lt;li&gt;We will go there next, to create our first table.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Create tables
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AuIsvnP-GExkuouJWCz-bhw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AuIsvnP-GExkuouJWCz-bhw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We first want to create a table to store movies. Let’s do that!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ag60IY9aT8AwHV7macirJ9Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ag60IY9aT8AwHV7macirJ9Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Name of the table.&lt;/li&gt;
&lt;li&gt;It is recommended to add an ID to all tables. You can use an Integer or UUID. We’ll use UUID. Because we don’t want to pass an ID every time we create an object, Hasura offers a method to create it automatically.&lt;/li&gt;
&lt;li&gt;Adding more fields.&lt;/li&gt;
&lt;li&gt;We need to define the primary key for each table. This will be our ID.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Create the following two tables:&lt;/p&gt;

&lt;p&gt;characters (id: UUID, name: Text, hair_color: Text, house: Text, wizard: Boolean, birth_year: Integer, patronus: Text)&lt;/p&gt;

&lt;p&gt;actors (id: UUID, name: Text, birth_year: Integer, awards: Integer)&lt;/p&gt;

&lt;h3&gt;
  
  
  Insert data
&lt;/h3&gt;

&lt;p&gt;Let’s add some data data:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2APg_KCC6g3W1DdvMQQ9xDwQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2APg_KCC6g3W1DdvMQQ9xDwQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Add one other character, as well as two movies and two actors.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Queries
&lt;/h3&gt;

&lt;p&gt;Now that we have some data, we can make our first query in GraphiQL.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;It will return the two characters that we have already inserted into our characters table.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;There are a lot of different constraints you can add to your queries. For example, you can make sure only to get a certain number of objects. Or only get the objects where a certain condition is true. All this is very well documented by Hasura: &lt;a href="https://docs.hasura.io/1.0/graphql/manual/queries/simple-object-queries.html" rel="noopener noreferrer"&gt;https://docs.hasura.io/1.0/graphql/manual/queries/simple-object-queries.html&lt;/a&gt;. You can read through it and tweak your queries, so that they return different results. You might have to add some more data in order to do so.&lt;/p&gt;

&lt;h3&gt;
  
  
  Relationships
&lt;/h3&gt;

&lt;p&gt;Currently, we have three tables that are all independent from each other. With a query, we can retrieve movies, characters and actors. But we cannot retrieve the movies with their characters and in turn the respective actors. In order to do this, we need to define relationships.&lt;/p&gt;

&lt;p&gt;There are two different types of relationships: the object relationship and the array relationship. The object relationship is a one-to-one relationship. For example, a character has a single nested resource that is called actor. The array relationship is a one-to-many relationship. For example, a movie will have an array of nested resources called scenes.&lt;/p&gt;

&lt;h4&gt;
  
  
  Object relationship
&lt;/h4&gt;

&lt;p&gt;Let’s first model the relationship between characters and actors. The first step is to add a actor_id to the characters table:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AttElZZv0tb5qBD3CExVjBg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AttElZZv0tb5qBD3CExVjBg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After adding the column, we need to edit it and to make sure that the actor_id is actually a foreign key, pointing to the actors table.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A5YOWaldGOwUtDefZXJhuXg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A5YOWaldGOwUtDefZXJhuXg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we go to the tab “Relationships” on characters, a suggested relationship will appear. That’s right — Hasura detects foreign keys automatically and makes suggestions regarding relationships. As a name, we’ll take “actor”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ao1tauUwZUGbqNvQbnRjkhg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ao1tauUwZUGbqNvQbnRjkhg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we want to connect the characters with the corresponding actors in our database. When we now look into the characters table, we can see that the actor_id for the previously created characters is NULL. We can now edit the data and add the ids of the actors that correspond to these characters.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AZZbfW2zcTgp-KmrisUEcAg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AZZbfW2zcTgp-KmrisUEcAg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A3hTER-xDWzQxa9AWQSpkTg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A3hTER-xDWzQxa9AWQSpkTg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the characters and their actors are linked. Now we can access fields from the actors along with the characters in the same query:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h4&gt;
  
  
  Array relationship
&lt;/h4&gt;

&lt;p&gt;The array relationship is a one-to-many relationship. This means that one object of a table can have several objects of another table. Let’s say in our example, one movie can have several scenes and each scene belongs to one movie. A scene has an id, a name, a location and a movie_id. So let’s create a new table called “scenes” to our database:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AWgc1n_UOAR18Y8BwECZFaw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AWgc1n_UOAR18Y8BwECZFaw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great! Now, just like we did before, we need to modify the table and make the movie_id a foreign key:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AJivOM3QBpwFI1sxWX6aOYQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AJivOM3QBpwFI1sxWX6aOYQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we now go to the movies table and click on “Relationships”, we can see the suggested array relationship for scenes. Let’s add this relationship and call it “scenes”. This is all that is necessary to create an array relationship. To test it, insert some rows into the scenes table.&lt;/p&gt;

&lt;h4&gt;
  
  
  Many-to-many relationship
&lt;/h4&gt;

&lt;p&gt;As explained before, the array relationship is a one-to-many relationship. However, in our case of movies and characters, we have a many-to-many relationship. One movie can have several characters and one character can appear in several movies. For this scenario, we need to create a join table that we will call “movie_characters” in which we can store the relationship between one movie and one character. Let’s create the “movie_characters” table that has an ID, a movie_id and a character_id.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ag38hM58tiPNlauI_n2HZuA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ag38hM58tiPNlauI_n2HZuA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the perspective of the movie_characters table, we need object relationships to both the movies table and the characters table. This is because in each movie_character, there is one movie and one character stored.&lt;/p&gt;

&lt;p&gt;Like above, edit both the movie_id and the character_id on the movie_character table and tick the checkbox for them to be foreign keys. Then add the correct reference table and the reference column. For the movie_id, the reference table is movies and for the character_id, the reference table is characters. For both reference columns, it will be ID.&lt;/p&gt;

&lt;p&gt;When you now click the tab “Relationships”, you’ll see two suggestions for object relationships. Add them both and call them “movie” and “character”. Once added, it should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AZiaD9kZDziOwCGkFsDbrqw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AZiaD9kZDziOwCGkFsDbrqw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course, like above, we need to create the relationships with our data. Create new rows in the movie_characters table for each movie — character relationship, using their IDs.&lt;/p&gt;

&lt;p&gt;Yayy, now all our tables are modelled with their correct relationships. Let’s test it with a query.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Isn’t this neat? With just one query, we are able to access several resources with those fields we want. Compared to REST where usually the whole object is returned, we can reduce the query to the essentials. This makes the API more efficient, more lightweight and easier to handle.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mutations
&lt;/h3&gt;

&lt;p&gt;So far, we learned how to get data from our API. But what about adding new data? In our case, we might want to add a movie or a character. For this, we need mutations. Mutations are easy to use with the GraphQL API and just like queries, we can try them in the Hasura console:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Let me explain what is happening here. Inside a mutation, we can call different methods like insert, update or delete on the resources that we store in our database. In our case, we want to insert a new movie. We need to pass the movies as objects and it is possible to insert several objects in one mutation. In the end, we need to return something, which is the ID of the newly created object in our example.&lt;/p&gt;

&lt;p&gt;Again, there is full documentation on mutations on the Hasura website: &lt;a href="https://docs.hasura.io/1.0/graphql/manual/mutations/index.html" rel="noopener noreferrer"&gt;https://docs.hasura.io/1.0/graphql/manual/mutations/index.html&lt;/a&gt;. Go through the examples and try some other mutations, like deleting a movie.&lt;/p&gt;

&lt;p&gt;That is it for now. I hope you had fun learning about GraphQL and that you are eager to extend your Harry Potter API with lots of new tables and data. If something is not clear, you can always send me an email at &lt;a href="mailto:marion.schleifer@gmail.com"&gt;marion.schleifer@gmail.com&lt;/a&gt; or message me over Twitter: &lt;a href="https://twitter.com/rubydwarf" rel="noopener noreferrer"&gt;https://twitter.com/rubydwarf&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Stay tuned for updates. I will soon publish another blogpost on how to connect your Hasura backend to your VueJS frontend 🎉&lt;/p&gt;

&lt;h3&gt;
  
  
  Join the community
&lt;/h3&gt;

&lt;p&gt;Hasura is being used by a growing number of developers. Join the friendly community and keep up with updates.&lt;/p&gt;

&lt;p&gt;If you want to start building your own projects with Hasura, you can join their discord channel here: &lt;a href="https://discordapp.com/invite/hasura" rel="noopener noreferrer"&gt;https://discordapp.com/invite/hasura&lt;/a&gt;. There is already a pretty large community and you will get help very quickly.&lt;/p&gt;

&lt;p&gt;🐦 Twitter: &lt;a href="https://twitter.com/hasurahq" rel="noopener noreferrer"&gt;https://twitter.com/hasurahq&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;⭐️ Github: &lt;a href="https://github.com/hasura/graphql-engine" rel="noopener noreferrer"&gt;https://github.com/hasura/graphql-engine&lt;/a&gt;&lt;/p&gt;

</description>
      <category>graphql</category>
      <category>backend</category>
      <category>opensource</category>
      <category>serverless</category>
    </item>
  </channel>
</rss>
