{"id":3266,"date":"2019-10-08T09:25:00","date_gmt":"2019-10-08T09:25:00","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/graphql-ruby-what-about-performance\/"},"modified":"2026-04-27T09:55:49","modified_gmt":"2026-04-27T09:55:49","slug":"graphql-ruby-kas-par-veiktspeju","status":"publish","type":"post","link":"https:\/\/thecodest.co\/lv\/blog\/graphql-ruby-what-about-performance\/","title":{"rendered":"GraphQL Ruby. K\u0101 ir ar veiktsp\u0113ju?"},"content":{"rendered":"\n<p>To present the problem, let&#8217;s assume the following application architecture:<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/drive.google.com\/file\/d\/1N4sWPJSls0S8FFHbpHCUVHBNBpEuSsyz\/view\n<\/div><\/figure>\n\n\n\n<p>And here the corresponding query in <strong>GraphQL<\/strong> to download the <a href=\"https:\/\/thecodest.co\/lv\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">data<\/a>. We fetch all links, along with the poster and its links added to the system,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">{\n  allLinks {\n    id\n    url\n    description\n    createdAt\n    postedBy {\n      id\n      name\n      links {\n        id\n      }\n    }\n  }\n}<\/code><\/pre>\n\n\n\n<p>As displayed below, we can see the classic n + 1 problem with relations here.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">Link Load (0.4ms)  SELECT \"links\".* FROM \"links\" ORDER BY created_at DESC\n  \u21b3 app\/controllers\/graphql_controller.rb:5:in `execute'\n  User Load (0.3ms)  SELECT \"users\".* FROM \"users\" WHERE \"users\".\"id\" = ? LIMIT ?  [[\"id\", 40], [\"LIMIT\", 1]]\n  \u21b3 app\/controllers\/graphql_controller.rb:5:in `execute'\n  Link Load (0.3ms)  SELECT \"links\".* FROM \"links\" WHERE \"links\".\"user_id\" = ?  [[\"user_id\", 40]]\n  \u21b3 app\/controllers\/graphql_controller.rb:5:in `execute'\n  User Load (0.1ms)  SELECT \"users\".* FROM \"users\" WHERE \"users\".\"id\" = ? LIMIT ?  [[\"id\", 38], [\"LIMIT\", 1]]\n  \u21b3 app\/controllers\/graphql_controller.rb:5:in `execute'\n  Link Load (0.1ms)  SELECT \"links\".* FROM \"links\" WHERE \"links\".\"user_id\" = ?  [[\"user_id\", 38]]\n  \u21b3 app\/controllers\/graphql_controller.rb:5:in `execute'\n  User Load (0.2ms)  SELECT \"users\".* FROM \"users\" WHERE \"users\".\"id\" = ? LIMIT ?  [[\"id\", 36], [\"LIMIT\", 1]]\n  \u21b3 app\/controllers\/graphql_controller.rb:5:in `execute'\n  Link Load (0.1ms)  SELECT \"links\".* FROM \"links\" WHERE \"links\".\"user_id\" = ?  [[\"user_id\", 36]]\n  \u21b3 app\/controllers\/graphql_controller.rb:5:in `execute'\n  User Load (0.1ms)  SELECT \"users\".* FROM \"users\" WHERE \"users\".\"id\" = ? LIMIT ?  [[\"id\", 34], [\"LIMIT\", 1]]\n  \u21b3 app\/controllers\/graphql_controller.rb:5:in `execute'\n  Link Load (0.2ms)  SELECT \"links\".* FROM \"links\" WHERE \"links\".\"user_id\" = ?  [[\"user_id\", 34]]\n  \u21b3 app\/controllers\/graphql_controller.rb:5:in `execute'\n  User Load (0.1ms)  SELECT \"users\".* FROM \"users\" WHERE \"users\".\"id\" = ? LIMIT ?  [[\"id\", 32], [\"LIMIT\", 1]]<\/code><\/pre>\n\n\n\n<p>In this case, it works exactly like this piece of <a href=\"https:\/\/thecodest.co\/lv\/dictionary\/what-is-code-refactoring\/\">code<\/a>:<br><code>Link.all.map(&amp;:user).map(&amp;:links)<\/code>.<\/p>\n\n\n\n<p>We seem to know the solution to the problem: <code>Link.includes(user: :links).map(&amp;:user).map(&amp;:links)<\/code>, but will it really work? Let&#8217;s check it out!<\/p>\n\n\n\n<p>To verify the fix, I changed the <strong>GraphQL<\/strong> query to only use a few fields and no relation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"graphql\" class=\"language-graphql\">{\n  allLinks {\n    id\n    url\n    description\n    createdAt\n  }\n}<\/code><\/pre>\n\n\n\n<p>Unfortunately, the result shows that, despite the lack of links in relation to the user and their links, we still attach this data to database query. Unfortunately, they are redundant and, with an even more complicated structure, it turns out to be simply inefficient.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"graphql\" class=\"language-graphql\">Processing by GraphqlController#execute as *\/*\n  Parameters: {\"query\"=>\"{n  allLinks {n    idn    urln    descriptionn    createdAtn  }n}\", \"graphql\"=>{\"query\"=>\"{n  allLinks {n    idn    urln    descriptionn    createdAtn  }n}\"}}\n  Link Load (0.3ms)  SELECT \"links\".* FROM \"links\" ORDER BY created_at DESC\n  \u21b3 app\/controllers\/graphql_controller.rb:5:in `execute'\n  User Load (0.3ms)  SELECT \"users\".* FROM \"users\" WHERE \"users\".\"id\" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)  [[\"id\", 40], [\"id\", 38], [\"id\", 36], [\"id\", 34], [\"id\", 32], [\"id\", 30], [\"id\", 28], [\"id\", 26], [\"id\", 24], [\"id\", 22], [\"id\", 20], [\"id\", 18], [\"id\", 16], [\"id\", 14], [\"id\", 12], [\"id\", 10], [\"id\", 8], [\"id\", 6], [\"id\", 4], [\"id\", 2]]\n  \u21b3 app\/controllers\/graphql_controller.rb:5:in `execute'\n  Link Load (0.3ms)  SELECT \"links\".* FROM \"links\" WHERE \"links\".\"user_id\" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)  [[\"user_id\", 2], [\"user_id\", 4], [\"user_id\", 6], [\"user_id\", 8], [\"user_id\", 10], [\"user_id\", 12], [\"user_id\", 14], [\"user_id\", 16], [\"user_id\", 18], [\"user_id\", 20], [\"user_id\", 22], [\"user_id\", 24], [\"user_id\", 26], [\"user_id\", 28], [\"user_id\", 30], [\"user_id\", 32], [\"user_id\", 34], [\"user_id\", 36], [\"user_id\", 38], [\"user_id\", 40]]\n  \u21b3 app\/controllers\/graphql_controller.rb:5:in `execute'\nCompleted 200 OK in 39ms (Views: 0.7ms | ActiveRecord: 0.9ms | Allocations: 8730)\n<\/code><\/pre>\n\n\n\n<p>In <strong>GraphQL<\/strong>, such problems are solved differently,simply by loading data in batches, assuming that the data is needed when it is put in the query. It is such a lazy loading. One of the most popular libraries is https:\/\/github.com\/Shopify\/graphql-batch\/.<\/p>\n\n\n\n<p>Unfortunately, its installation is not as hassle-free as it may seem. The data loaders are available here: https:\/\/github.com\/Shopify\/graphql-batch\/tree\/master\/examples, I mean the <code>RecordLoader<\/code> class and the<code>AssociationLoader<\/code> class. Let&#8217;s classically install the <code>gem 'graphql-batch'<\/code> library and then add it to our schema, as well as loaders:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"># graphql-ruby\/app\/graphql\/graphql_tutorial_schema.rb\nclass GraphqlTutorialSchema &lt; GraphQL::Schema\n  query Types::QueryType\n  mutation Types::MutationType\n  use GraphQL::Batch\n  ...\nend<\/code><\/pre>\n\n\n\n<p>And our types:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"># graphql-ruby\/app\/graphql\/types\/link_type.rb\nmodule Types\n  class LinkType &lt; BaseNode\n    field :created_at, DateTimeType, null: false\n    field :url, String, null: false\n    field :description, String, null: false\n    field :posted_by, UserType, null: false, method: :user\n    field :votes, [Types::VoteType], null: false\n\n    def user\n      Loaders::RecordLoader.for(User).load(object.user_id)\n    end\n  end\nend\n\n# graphql-ruby\/app\/graphql\/types\/user_type.rb\nmodule Types\n  class UserType &lt; BaseNode\n    field :created_at, DateTimeType, null: false\n    field :name, String, null: false\n    field :email, String, null: false\n    field :votes, [VoteType], null: false\n    field :links, [LinkType], null: false\n\n    def links\n      Loaders::AssociationLoader.for(User, :links).load(object)\n    end\n  end\nend\n<\/code><\/pre>\n\n\n\n<p>As a result of using the loaders, we batch the data and we query for data in two simple sql queries:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"graphql\" class=\"language-graphql\">Started POST \"\/graphql\" for ::1 at 2021-06-16 22:40:17 +0200\n   (0.1ms)  SELECT sqlite_version(*)\nProcessing by GraphqlController#execute as *\/*\n  Parameters: {\"query\"=>\"{n  allLinks {n    idn    urln    descriptionn    createdAtn    postedBy {n      idn      namen      links {n        idn      }n    }n  }n}\", \"graphql\"=>{\"query\"=>\"{n  allLinks {n    idn    urln    descriptionn    createdAtn    postedBy {n      idn      namen      links {n        idn      }n    }n  }n}\"}}\n  Link Load (0.4ms)  SELECT \"links\".* FROM \"links\"\n  \u21b3 app\/controllers\/graphql_controller.rb:5:in `execute'\n  User Load (0.9ms)  SELECT \"users\".* FROM \"users\" WHERE \"users\".\"id\" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)  [[\"id\", 2], [\"id\", 4], [\"id\", 6], [\"id\", 8], [\"id\", 10], [\"id\", 12], [\"id\", 14], [\"id\", 16], [\"id\", 18], [\"id\", 20], [\"id\", 22], [\"id\", 24], [\"id\", 26], [\"id\", 28], [\"id\", 30], [\"id\", 32], [\"id\", 34], [\"id\", 36], [\"id\", 38], [\"id\", 40]]\n  \u21b3 app\/graphql\/loaders\/record_loader.rb:12:in `perform'\n  Link Load (0.5ms)  SELECT \"links\".* FROM \"links\" WHERE \"links\".\"user_id\" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)  [[\"user_id\", 2], [\"user_id\", 4], [\"user_id\", 6], [\"user_id\", 8], [\"user_id\", 10], [\"user_id\", 12], [\"user_id\", 14], [\"user_id\", 16], [\"user_id\", 18], [\"user_id\", 20], [\"user_id\", 22], [\"user_id\", 24], [\"user_id\", 26], [\"user_id\", 28], [\"user_id\", 30], [\"user_id\", 32], [\"user_id\", 34], [\"user_id\", 36], [\"user_id\", 38], [\"user_id\", 40]]\n  \u21b3 app\/graphql\/loaders\/association_loader.rb:46:in `preload_association'\nCompleted 200 OK in 62ms (Views: 1.3ms | ActiveRecord: 1.8ms | Allocations: 39887)\n<\/code><\/pre>\n\n\n\n<p>There are also other solutions that solve this problem, such as:<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/github.com\/exAspArk\/batch-loader#basic-example\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Complexity of queries<\/h2>\n\n\n\n<p>N + 1 queries are not everything, in <strong>GraphQL<\/strong> we can freely carry over the next attributes. By default, it set to 1. This can sometimes be too much for the server, especially in a situation where we can freely nest data. How to deal with it? We can limit the complexity of the query, but to do this, we also need to specify their cost in the attributes. By default it set to 1. We set this cost using the <code>complexity:<\/code> attribute, where we can enter data: <code>field: links, [LinkType], null: false, complexity: 101<\/code>. If limiting is to actually work, you still need to introduce the maximum limit to your scheme:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">class GraphqlTutorialSchema &lt; GraphQL::Schema\n  query Types::QueryType\n  mutation Types::MutationType\n  use GraphQL::Batch\n  max_complexity 100\n  ...\nend\n\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Tracing<\/h2>\n\n\n\n<p><strong>GraphQL<\/strong> processes queries differently, and tracing is not that simple if compares to what we can do locally. Unfortunately, the rack mini profiler or a regular SQL log will not tell <a href=\"https:\/\/thecodest.co\/lv\/blog\/why-us-companies-are-opting-for-polish-developers\/\">us<\/a> everything and will not point which part of the query is responsible for a given time slice. In the case of GraphQL-Ruby, we can use commercial solutions available here: <a href=\"https:\/\/graphql-ruby.org\/queries\/tracing\">https:\/\/graphql-ruby.org\/queries\/tracing<\/a>, or try to prepare our own tracing. Below, the snippet looks like a local tracer.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"># lib\/my_custom_tracer.rb\nclass MyCustomTracer &lt; GraphQL::Tracing::PlatformTracing\n  self.platform_keys = {\n    'lex' => 'graphql.lex',\n    'parse' => 'graphql.parse',\n    'validate' => 'graphql.validate',\n    'analyze_query' => 'graphql.analyze_query',\n    'analyze_multiplex' => 'graphql.analyze_multiplex',\n    'execute_multiplex' => 'graphql.execute_multiplex',\n    'execute_query' => 'graphql.execute_query',\n    'execute_query_lazy' => 'graphql.execute_query_lazy'\n  }\n\n  def platform_trace(platform_key, key, _data, &amp;block)\n    start = ::Process.clock_gettime ::Process::CLOCK_MONOTONIC\n    result = block.call\n    duration = ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) - start\n    observe(platform_key, key, duration)\n    result\n  end\n\n  def platform_field_key(type, field)\n    \"graphql.#{type.graphql_name}.#{field.graphql_name}\"\n  end\n\n  def platform_authorized_key(type)\n    \"graphql.authorized.#{type.graphql_name}\"\n  end\n\n  def platform_resolve_type_key(type)\n    \"graphql.resolve_type.#{type.graphql_name}\"\n  end\n\n  def observe(platform_key, key, duration)\n    return if key == 'authorized'\n\n    puts \"platform_key: #{platform_key}, key: #{key}, duration: #{(duration * 1000).round(5)} ms\".yellow\n  end\nend<\/code><\/pre>\n\n\n\n<p>Installation is also extremely simple, you need to include the tracer information in the schema <code>tracer (MyCustomTracer.new)<\/code> configuration. As in the example below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"># graphql-ruby\/app\/graphql\/graphql_tutorial_schema.rb\nclass GraphqlTutorialSchema &lt; GraphQL::Schema\n  query Types::QueryType\n  mutation Types::MutationType\n  use GraphQL::Batch\n  tracer(MyCustomTracer.new)\n  ...\nend\n\n<\/code><\/pre>\n\n\n\n<p>The output from such tracing looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"graphql\" class=\"language-graphql\">Started POST \"\/graphql\" for ::1 at 2021-06-17 22:02:44 +0200\n   (0.1ms)  SELECT sqlite_version(*)\nProcessing by GraphqlController#execute as *\/*\n  Parameters: {\"query\"=>\"{n  allLinks {n    idn    urln    descriptionn    createdAtn    postedBy {n      idn      namen      links {n        idn      }n    }n  }n}\", \"graphql\"=>{\"query\"=>\"{n  allLinks {n    idn    urln    descriptionn    createdAtn    postedBy {n      idn      namen      links {n        idn      }n    }n  }n}\"}}\nplatform_key: graphql.lex, key: lex, duration: 0.156 ms\nplatform_key: graphql.parse, key: parse, duration: 0.108 ms\nplatform_key: graphql.validate, key: validate, duration: 0.537 ms\nplatform_key: graphql.analyze_query, key: analyze_query, duration: 0.123 ms\nplatform_key: graphql.analyze_multiplex, key: analyze_multiplex, duration: 0.159 ms\n  Link Load (0.4ms)  SELECT \"links\".* FROM \"links\"\n  \u21b3 app\/graphql\/graphql_tutorial_schema.rb:21:in `platform_trace'\nplatform_key: graphql.execute_query, key: execute_query, duration: 15.562 ms\n  \u21b3 app\/graphql\/loaders\/record_loader.rb:12:in `perform'\n  \u21b3 app\/graphql\/loaders\/association_loader.rb:46:in `preload_association'\nplatform_key: graphql.execute_query_lazy, key: execute_query_lazy, duration: 14.12 ms\nplatform_key: graphql.execute_multiplex, key: execute_multiplex, duration: 31.11 ms\nCompleted 200 OK in 48ms (Views: 1.2ms | ActiveRecord: 2.0ms | Allocations: 40128)\n\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p><strong>GraphQL<\/strong> is not a new technology anymore, but the solutions to its problems are not fully standardized if they are not part of the library. The implementation of this technology in the <a href=\"https:\/\/thecodest.co\/lv\/dictionary\/why-do-projects-fail\/\">project<\/a> gives a lot of opportunities to interact with the frontend and I personally consider it to be a new quality in relation to what REST <a href=\"https:\/\/thecodest.co\/lv\/blog\/compare-staff-augmentation-firms-that-excel-in-api-team-staffing-for-financial-technology-projects\/\">API<\/a> offers.<\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\">Why you should (probably) use Typescript<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/how-not-to-kill-a-project-with-bad-coding-practices\/\">How not to kill a project with bad coding practices?<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/data-fetching-strategies-in-nextjs\/\">Data fetching strategies in NextJS<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>GraphQL, t\u0101pat k\u0101 jebkurai citai tehnolo\u0123ijai, ir savas probl\u0113mas, no kur\u0101m da\u017eas tie\u0161i izriet no arhitekt\u016bras, bet da\u017eas ir identiskas t\u0101m, kas sastopamas jebkur\u0101 cit\u0101 lietojumprogramm\u0101. Tom\u0113r risin\u0101jumi ir piln\u012bgi at\u0161\u0137ir\u012bgi.<\/p>","protected":false},"author":2,"featured_media":3267,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3266","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>GraphQL Ruby. What about performance? - The Codest<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/lv\/emuars\/graphql-ruby-kas-par-veiktspeju\/\" \/>\n<meta property=\"og:locale\" content=\"lv_LV\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GraphQL Ruby. What about performance?\" \/>\n<meta property=\"og:description\" content=\"GraphQL, like any technology, has its problems, some of them directly result from the architecture and some are identical to what we see in any other application. However, the solutions are completely different.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/lv\/emuars\/graphql-ruby-kas-par-veiktspeju\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-08T09:25:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-27T09:55:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/grahql-ruby.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 min\u016btes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/graphql-ruby-what-about-performance\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/graphql-ruby-what-about-performance\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"GraphQL Ruby. What about performance?\",\"datePublished\":\"2019-10-08T09:25:00+00:00\",\"dateModified\":\"2026-04-27T09:55:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/graphql-ruby-what-about-performance\\\/\"},\"wordCount\":588,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/graphql-ruby-what-about-performance\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/grahql-ruby.jpg\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"lv-LV\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/graphql-ruby-what-about-performance\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/graphql-ruby-what-about-performance\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/graphql-ruby-what-about-performance\\\/\",\"name\":\"GraphQL Ruby. What about performance? - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/graphql-ruby-what-about-performance\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/graphql-ruby-what-about-performance\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/grahql-ruby.jpg\",\"datePublished\":\"2019-10-08T09:25:00+00:00\",\"dateModified\":\"2026-04-27T09:55:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/graphql-ruby-what-about-performance\\\/#breadcrumb\"},\"inLanguage\":\"lv-LV\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/graphql-ruby-what-about-performance\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"lv-LV\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/graphql-ruby-what-about-performance\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/grahql-ruby.jpg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/grahql-ruby.jpg\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/graphql-ruby-what-about-performance\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GraphQL Ruby. What about performance?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"lv-LV\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"lv-LV\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"lv-LV\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/lv\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"GraphQL Ruby. K\u0101 ir ar veiktsp\u0113ju? - The Codest","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thecodest.co\/lv\/emuars\/graphql-ruby-kas-par-veiktspeju\/","og_locale":"lv_LV","og_type":"article","og_title":"GraphQL Ruby. What about performance?","og_description":"GraphQL, like any technology, has its problems, some of them directly result from the architecture and some are identical to what we see in any other application. However, the solutions are completely different.","og_url":"https:\/\/thecodest.co\/lv\/emuars\/graphql-ruby-kas-par-veiktspeju\/","og_site_name":"The Codest","article_published_time":"2019-10-08T09:25:00+00:00","article_modified_time":"2026-04-27T09:55:49+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/grahql-ruby.jpg","type":"image\/jpeg"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"3 min\u016btes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/graphql-ruby-what-about-performance\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/graphql-ruby-what-about-performance\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"GraphQL Ruby. What about performance?","datePublished":"2019-10-08T09:25:00+00:00","dateModified":"2026-04-27T09:55:49+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/graphql-ruby-what-about-performance\/"},"wordCount":588,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/graphql-ruby-what-about-performance\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/grahql-ruby.jpg","articleSection":["Software Development"],"inLanguage":"lv-LV","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/graphql-ruby-what-about-performance\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/graphql-ruby-what-about-performance\/","url":"https:\/\/thecodest.co\/blog\/graphql-ruby-what-about-performance\/","name":"GraphQL Ruby. K\u0101 ir ar veiktsp\u0113ju? - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/graphql-ruby-what-about-performance\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/graphql-ruby-what-about-performance\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/grahql-ruby.jpg","datePublished":"2019-10-08T09:25:00+00:00","dateModified":"2026-04-27T09:55:49+00:00","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/graphql-ruby-what-about-performance\/#breadcrumb"},"inLanguage":"lv-LV","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/graphql-ruby-what-about-performance\/"]}]},{"@type":"ImageObject","inLanguage":"lv-LV","@id":"https:\/\/thecodest.co\/blog\/graphql-ruby-what-about-performance\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/grahql-ruby.jpg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/grahql-ruby.jpg","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/graphql-ruby-what-about-performance\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"GraphQL Ruby. What about performance?"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"The Codest","description":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"lv-LV"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"lv-LV","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"lv-LV","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/lv\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/posts\/3266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/comments?post=3266"}],"version-history":[{"count":10,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/posts\/3266\/revisions"}],"predecessor-version":[{"id":7831,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/posts\/3266\/revisions\/7831"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/media\/3267"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/media?parent=3266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/categories?post=3266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/tags?post=3266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}