<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.softwareheritage.org/index.php?action=history&amp;feed=atom&amp;title=Create_graphql_query_cost_calculator_%28GSoC_task%29</id>
	<title>Create graphql query cost calculator (GSoC task) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.softwareheritage.org/index.php?action=history&amp;feed=atom&amp;title=Create_graphql_query_cost_calculator_%28GSoC_task%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.softwareheritage.org/index.php?title=Create_graphql_query_cost_calculator_(GSoC_task)&amp;action=history"/>
	<updated>2026-04-20T14:41:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://wiki.softwareheritage.org/index.php?title=Create_graphql_query_cost_calculator_(GSoC_task)&amp;diff=1696&amp;oldid=prev</id>
		<title>Jayesh: Created page with &quot;== Introduction ==  Implement the first version of a GraphQL query cost calculator as a middleware.  == Task description ==  Since GraphQL exposes a graph, queries could get r...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.softwareheritage.org/index.php?title=Create_graphql_query_cost_calculator_(GSoC_task)&amp;diff=1696&amp;oldid=prev"/>
		<updated>2022-03-08T08:37:42Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Introduction ==  Implement the first version of a GraphQL query cost calculator as a middleware.  == Task description ==  Since GraphQL exposes a graph, queries could get r...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Implement the first version of a GraphQL query cost calculator as a middleware.&lt;br /&gt;
&lt;br /&gt;
== Task description ==&lt;br /&gt;
&lt;br /&gt;
Since GraphQL exposes a graph, queries could get really complex and can add a lot of load to the storage systems.&lt;br /&gt;
Eg: A query like [https://forge.softwareheritage.org/P1305 this] will execute at least 4 different storage queries in a single request.&lt;br /&gt;
&lt;br /&gt;
Though it is possible to restrict queries by size/length, a basic query cost calculator is a necessity.&lt;br /&gt;
The very first version can be implemented as a GraphQL middleware.&lt;br /&gt;
This will involve finding the relative complexity of a query in the backend and some basic &lt;br /&gt;
arithmetic to calculate the total query cost.&lt;br /&gt;
The resulting number can be used to accept or reject a query.&lt;br /&gt;
The same number can later be used for user level throttling and rate limiting as well.&lt;br /&gt;
&lt;br /&gt;
== Desirable skills ==&lt;br /&gt;
&lt;br /&gt;
* Python&lt;br /&gt;
* Basic knowledge of a middleware.&lt;br /&gt;
* SQL&lt;br /&gt;
&lt;br /&gt;
== Potential mentors ==&lt;/div&gt;</summary>
		<author><name>Jayesh</name></author>
	</entry>
</feed>