Sunny’s GSOC Adventure: The Technical

In our previous post we saw the basic setup for our django project. If not you can read about it here. In this post we shall explore our graphql_api app in detail…

Note: We shall see the detailed explanation of the contents of each file in the subsequent blog posts. This post only gives a brief overview.


  1. Contains the urls of graphql_api. There is only one url which handles requests and responses of our main GraphQL Schema.
  2. Contains the unit and integration tests.
  3. We are using celery as our response is going to be asynchrous. Hence this file contains our celery tasks.
  4. Contains our main GraphQL Schema.
  5. Contains the web socket routes for our GraphQL Schema.

The other files are empty or not needed.


  1. grapheneObjects: This is the only subfolder in our graphql_api app. It contains subschema details as folders which map to our database indices. Eg. Look at the subfolder “article”.

Files inside grapheneObjects subfolder:

  1. : Contains error and exception messages relevant to our API.
  2. : Contains constants used by our code.
  3. : Contains functions which are used by resolvers to fetch data.
  4. : Certain fields have similar structure (eg. a field with “text” and “ontologyTerms” subfields. Hence this file contains the common field graphene objects (ObjectType).
  5. Similar to above except instead of having graphene objects (ObjectType) it has graphene input objects (InputObjectType).

Subfolders inside grapheneObjects subfolder:

Every subfolder inside grapheneObjects subfolder maps to an index. Also all these subfolders have the same file structure. Hence let us take an example of article subfolder.

Let us look at what the files and folders inside this folder represent:

Files inside article subfolder:

  1. : It contains GraphQL schema for the particular index (In this case ArticleSchema). Along with ArticleSchema it also includes the classes ArticleNode and ArticleConnection (as we are using Relay specification).
  2. : Contains the definition for all the fields for the article index which are of ObjectType.
  3. : It contains the dataloader which can help to batch and cache DB results, so that performance can be optimized. This file contains the dataloader instance specific to article index.
  4. arguments -> : Inside the sole subfolder arguments there is only one file called This file includes the definition of all the arguments of the ArticleSchema.

Next up : Fetching single document.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store