wikimedia/mediawiki-extensions-Wikibase

View on GitHub
build/dist-size/analyze/queries/getSizes.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict';

const gql = require( 'apollo-boost' ).gql;

module.exports = function ( repoOwner, repoName, filePath, history ) {
    return gql( `
        query getByteSize {
            repository( owner: "${repoOwner}", name: "${repoName}" ) {
            ` +
                history.map( ( value, index ) => {
                    return `commit${index}: object( expression: "${value.oid}:${filePath}" ) {
                                ... on Blob {
                                        byteSize
                                    }
                                }
                            `;
                } ).join( '\n' ) +
            `}
        }
    ` );
};