Skip to content

Instantly share code, notes, and snippets.

Aggregate (cost=174088.70..174088.71 rows=1 width=32)
-> Nested Loop Left Join (cost=58.68..174088.66 rows=2 width=126)
-> Nested Loop (cost=0.98..173973.19 rows=2 width=98)
-> Index Scan using "Study_StudyInstanceUID_key" on "Study" (cost=0.42..8.44 rows=1 width=4)
Index Cond: (("StudyInstanceUID")::numeric = 1.2::numeric)
-> Index Scan using "Series_SeriesInstanceUID_study_id_key" on "Series" (cost=0.56..173964.69 rows=7 width=102)
Index Cond: (study_id = "Study".id)
Filter: (("SeriesNumber" < 54) AND (("Modality")::text = 'something'::text) AND ((("SeriesDescription")::text ~~* '%somethingElse%'::text) OR (("SeriesDescription")::text ~~* '%xyz%'::text) OR (("SeriesDescription")::text ~~* '%somethingElseV2%'::text)))
-> Aggregate (cost=57.70..57.71 rows=1 width=32)
-> Nested Loop Left Join (cost=49.64..57.69 rows=1 width=32)
vacuum analyze "MrSeries";
vacuum analyze "MrVolume";
create index on "MrSeries" (series_id);
create index on "MrVolume" (mr_series_id);
Aggregate (cost=2439653.08..2439653.09 rows=1 width=32)
-> Nested Loop Left Join (cost=1132840.87..2439653.05 rows=2 width=126)
-> Nested Loop (cost=0.98..173973.19 rows=2 width=98)
-> Index Scan using "Study_StudyInstanceUID_key" on "Study" (cost=0.42..8.44 rows=1 width=4)
Index Cond: (("StudyInstanceUID")::numeric = 1.2::numeric)
-> Index Scan using "Series_SeriesInstanceUID_study_id_key" on "Series" (cost=0.56..173964.69 rows=7 width=102)
Index Cond: (study_id = "Study".id)
Filter: (("SeriesNumber" < 54) AND (("Modality")::text = 'something'::text) AND ((("SeriesDescription")::text ~~* '%somethingElse%'::text) OR (("SeriesDescription")::text ~~* '%XYZ%'::text) OR (("SeriesDescription")::text ~~* '%somethingElseV2%'::text)))
-> Aggregate (cost=1132839.90..1132839.91 rows=1 width=32)
-> Nested Loop Left Join (cost=1066271.29..1132839.88 rows=1 width=32)
query {
Series(where:
{_and: [
{studyBystudyId: {StudyInstanceUID: {_eq: 1.2}}},
{Modality: {_eq: "something"}},
{SeriesNumber: {_lt: 54}},
{_or: [{SeriesDescription: {_ilike: "%somethingElse%"}},
{SeriesDescription: {_ilike: "%XYZ%"}},
{SeriesDescription: {_ilike: "%somethingElseV2%"}}
]}

Hasura Technologies Pvt. Ltd. Contributor License Agreement

This Contributor License Agreement (“Agreement”) is entered into between Hasura Technologies Pvt. Ltd., (“Hasura,” “we” or “us”.) and You. Accordingly, You hereby agree to the following terms for your present and future contributions submitted to Hasura:

  1. Definitions:

    (a) "You" (or "your") shall mean the copyright owner (whether an individual or organization) or a party authorized by the copyright owner that is making this Agreement with Hasura. For Entities, the Entity making a Contribution and all other Entities that control, are controlled by, or are under common control with that Entity are considered to be a single Contributor. For the purposes of this definition, “control” means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity

(b) "Contri

@dsandip
dsandip / cURL_example.md
Last active July 27, 2018 10:02
Example cURL to query GraphQL endpoint

cURL example to test the query

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"query":"query { medication ( where:{ _and: [ { diagnosis_code: {_in: [\"S00-T88\",\"T20-R73\"]}}, { price: {_lt: 150}}, { inventory: {_gt: 10}} ] } ) { id name diagnosis_code price inventory } }","variables":null}' \
  https://hasura-graphql-test.herokuapp.com/v1alpha1/graphql

Try this out yourself

@dsandip
dsandip / articles_authors.graphql
Created June 8, 2018 14:01
A list of all articles and their authors
query {
allArticles(){
title
views
author{
firstName
lastName
}
}
}
@dsandip
dsandip / authors_articles.graphql
Last active June 8, 2018 13:57
query for all authors and their articles
query {
allAuthors(){
firstName
lastName
articles{
title
views
}
}
}
@dsandip
dsandip / schema.graphql
Last active June 8, 2018 13:55
schema for a blog app's database
const typeDefs = `
type Query {
author(firstName: String, lastName: String): Author
allAuthors: [Author]
allArticles: [Article]
}
type Author {
id: Int