This file contains hidden or 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
| const { parse } = require('graphql/language'); | |
| /** | |
| * Calculates the cost of a GraphQL query based on its structure. | |
| * | |
| * @param {string} query - The GraphQL query to calculate the cost for. | |
| * @param {boolean} [debug=false] - If true, additional debug information will be logged. | |
| * @return {number} The total cost of the query. | |
| */ | |
| function calculateQueryCost(query, debug = true) { |
OlderNewer