restorando / graphql-query-whitelist Goto Github PK
View Code? Open in Web Editor NEWGraphQL query whitelisting middleware
License: MIT License
GraphQL query whitelisting middleware
License: MIT License
The gql-whitelist
command specifies the --header
option as non-required:
$ node_modules/.bin/gql-whitelist
Stores the queries residing in the specified directories.
Usage: gql-whitelist dir1 [dir2] [dir3]
Options:
--endpoint Base URL of query whitelist API [required]
--header Header to send to the API: e.g key=value
Missing required arguments: endpoint
But when the command is run without it, it crashes:
$ node_modules/.bin/gql-whitelist --endpoint https://redo-graphql.restorando.com/whitelist
/Users/demian/IdeaProjects/emmett/node_modules/graphql-query-whitelist/dist/utils/gql-whitelist.js:44
var _header$split = header.split(/=(.+)/),
^
TypeError: Cannot read property 'split' of undefined
at /Users/demian/IdeaProjects/emmett/node_modules/graphql-query-whitelist/dist/utils/gql-whitelist.js:44:31
at Array.reduce (native)
at parseHeaders (/Users/demian/IdeaProjects/emmett/node_modules/graphql-query-whitelist/dist/utils/gql-whitelist.js:43:18)
at Object.<anonymous> (/Users/demian/IdeaProjects/emmett/node_modules/graphql-query-whitelist/dist/utils/gql-whitelist.js:58:12)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
I can try and have a stab at this, but what is the expected behavior? Should the --header
option be required, or should it be ignored when the user doesn't pass any?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.