New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

graphql-ruby-client

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-ruby-client - npm Package Compare versions

Comparing version 1.11.1 to 1.11.2

8

CHANGELOG.md
# graphql-ruby-client
# 1.11.2 (26 August 2022)
- Sync: Add a `--header` option for custom headers #4171
# 1.11.1 (19 July 2022)
- Subscriptions: ActionCableLink: only forward the result if `data` or `errors` is present #4114
# 1.11.0 (4 July 2022)

@@ -4,0 +12,0 @@

10

cli.js

@@ -11,3 +11,3 @@ #!/usr/bin/env node

if (argv.help || argv.h) {
console.log("usage: graphql-ruby-client sync <options>\n\n Read .graphql files and push the contained\n operations to a GraphQL::Pro::OperationStore\n\nrequired arguments:\n --url=<endpoint-url> URL where data should be POSTed\n --client=<client-name> Identifier for this client application\n\noptional arguments:\n --path=<path> Path to .graphql files (default is \"./**/*.graphql\")\n --outfile=<generated-filename> Target file for generated code\n --outfile-type=<type> Target type for generated code (default is \"js\")\n --key=<key> HMAC authentication key\n --relay-persisted-output=<path> Path to a .json file from \"relay-compiler ... --persist-output\"\n (Outfile generation is skipped by default.)\n --apollo-codegen-json-output=<path> Path to a .json file from \"apollo client:codegen ... --target json\"\n (Outfile generation is skipped by default.)\n --apollo-android-operation-output=<path> Path to a .json file from Apollo-Android's \"generateOperationOutput\" feature.\n (Outfile generation is skipped by default.)\n --mode=<mode> Treat files like a certain kind of project:\n relay: treat files like relay-compiler output\n project: treat files like a cohesive project (fragments are shared, names must be unique)\n file: treat each file like a stand-alone operation\n\n By default, this flag is set to:\n - \"relay\" if \"__generated__\" in the path\n - otherwise, \"project\"\n --add-typename Automatically adds the \"__typename\" field to your queries\n --quiet Suppress status logging\n --verbose Print debug output\n --help Print this message\n");
console.log("usage: graphql-ruby-client sync <options>\n\n Read .graphql files and push the contained\n operations to a GraphQL::Pro::OperationStore\n\nrequired arguments:\n --url=<endpoint-url> URL where data should be POSTed\n --client=<client-name> Identifier for this client application\n\noptional arguments:\n --path=<path> Path to .graphql files (default is \"./**/*.graphql\")\n --outfile=<generated-filename> Target file for generated code\n --outfile-type=<type> Target type for generated code (default is \"js\")\n --key=<key> HMAC authentication key\n --relay-persisted-output=<path> Path to a .json file from \"relay-compiler ... --persist-output\"\n (Outfile generation is skipped by default.)\n --apollo-codegen-json-output=<path> Path to a .json file from \"apollo client:codegen ... --target json\"\n (Outfile generation is skipped by default.)\n --apollo-android-operation-output=<path> Path to a .json file from Apollo-Android's \"generateOperationOutput\" feature.\n (Outfile generation is skipped by default.)\n --mode=<mode> Treat files like a certain kind of project:\n relay: treat files like relay-compiler output\n project: treat files like a cohesive project (fragments are shared, names must be unique)\n file: treat each file like a stand-alone operation\n\n By default, this flag is set to:\n - \"relay\" if \"__generated__\" in the path\n - otherwise, \"project\"\n --header=<header>:<value> Add a header to the outgoing HTTP request\n (may be repeated)\n --add-typename Automatically adds the \"__typename\" field to your queries\n --quiet Suppress status logging\n --verbose Print debug output\n --help Print this message\n");
}

@@ -20,2 +20,9 @@ else {

else {
var parsedHeaders = {};
if (argv.header) {
argv.header.forEach(function (h) {
var headerParts = h.split(":");
parsedHeaders[headerParts[0]] = headerParts[1];
});
}
var result = (0, index_1.default)({

@@ -32,2 +39,3 @@ path: argv.path,

mode: argv.mode,
headers: parsedHeaders,
addTypename: argv["add-typename"],

@@ -34,0 +42,0 @@ quiet: argv.hasOwnProperty("quiet"),

2

package.json
{
"name": "graphql-ruby-client",
"version": "1.11.1",
"version": "1.11.2",
"description": "JavaScript client for graphql-ruby",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -31,3 +31,2 @@ "use strict";

var payload = gatherOperations(options);
console.log(options, payload);
var generatedCode = generateClientCode(options.client, payload.operations, options.clientType);

@@ -34,0 +33,0 @@ return generatedCode;

@@ -18,2 +18,5 @@ import { ClientOperation } from "./generateClient";

addTypename?: boolean;
headers?: {
[key: string]: string;
};
}

@@ -38,2 +41,3 @@ /**

* @param {Boolean} options.verbose - If true, log debug output
* @param {Object<String, String>} options.headers - If present, extra headers to add to the HTTP request
* @return {Promise} Rejects with an Error or String if something goes wrong. Resolves with the operation payload if successful.

@@ -40,0 +44,0 @@ */

@@ -29,2 +29,3 @@ "use strict";

* @param {Boolean} options.verbose - If true, log debug output
* @param {Object<String, String>} options.headers - If present, extra headers to add to the HTTP request
* @return {Promise} Rejects with an Error or String if something goes wrong. Resolves with the operation payload if successful.

@@ -139,2 +140,3 @@ */

verbose: verbose,
headers: options.headers,
};

@@ -141,0 +143,0 @@ var sendPromise = Promise.resolve(sendFunc(payload, sendOpts));

@@ -6,2 +6,3 @@ interface SendPayloadOptions {

verbose?: boolean;
headers?: [string];
}

@@ -19,2 +20,3 @@ /**

* @param {Boolean} options.verbose - (optional) if true, print extra info for debugging
* @param {Object<String, String>} options.headers - (optional) extra headers for the request
* @return {Promise}

@@ -21,0 +23,0 @@ */

@@ -21,2 +21,3 @@ "use strict";

* @param {Boolean} options.verbose - (optional) if true, print extra info for debugging
* @param {Object<String, String>} options.headers - (optional) extra headers for the request
* @return {Promise}

@@ -38,2 +39,3 @@ */

};
var allHeaders = Object.assign({}, options.headers, defaultHeaders);
var httpOptions = {

@@ -46,3 +48,3 @@ protocol: parsedURL.protocol,

method: 'POST',
headers: defaultHeaders,
headers: allHeaders,
};

@@ -49,0 +51,0 @@ // If an auth key was provided, add a HMAC header

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc