Last active
January 9, 2021 06:44
-
-
Save igorlukanin/94caa7a838c76dbc5688691a60d599ac to your computer and use it in GitHub Desktop.
Cube.js GraphQL example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on https://github.com/cube-js/cube.js/blob/master/examples/hacktoberfest/dashboard/src/Card/LanguageCard.js | |
// Cube.js Query | |
{ | |
measures: [ 'Repos.count' ], | |
dimensions: [ 'Repos.language' ], | |
} | |
// Cube.js GraphQL | |
{ | |
Repos { | |
count | |
language | |
} | |
} | |
// Cube.js Query | |
const MostUsedKnownLanguage = { | |
measures: [ 'Repos.count' ], | |
dimensions: [ 'Repos.language' ], | |
filters: [ { | |
dimension: 'Repos.language', | |
operator: 'notEquals', | |
values: [ 'Unknown' ], | |
} ], | |
order: { | |
'Repos.count': 'desc', | |
}, | |
limit: 1, | |
} | |
// Cube.js GraphQL | |
query MostUsedKnownLanguage(limit: 1) { | |
Repos { | |
count(orderBy: DESC) | |
language(filter: { operator: NOT_EQUALS, values: [ 'Unknown' ] }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment