Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphql-http

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-http - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

40

lib/audits/server.js

@@ -325,2 +325,13 @@ "use strict";

}),
(0, utils_1.audit)('SHOULD not contain the data entry on JSON parsing failure when accepting application/graphql-response+json', async () => {
const res = await fetchFn(opts.url, {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: '{ "not a JSON',
});
(0, utils_1.assert)('Data entry', (await res.json()).data).toBe(undefined);
}),
(0, utils_1.audit)('MUST use 4xx or 5xx status codes if parameters are invalid when accepting application/graphql-response+json', async () => {

@@ -345,2 +356,11 @@ const url = new URL(opts.url);

}),
(0, utils_1.audit)('SHOULD not contain the data entry if parameters are invalid when accepting application/graphql-response+json', async () => {
const url = new URL(opts.url);
url.searchParams.set('qeury' /* typo */, '{ __typename }');
const res = await fetchFn(url.toString(), {
method: 'GET',
headers: { accept: 'application/graphql-response+json' },
});
(0, utils_1.assert)('Data entry', (await res.json()).data).toBe(undefined);
}),
(0, utils_1.audit)('MUST use 4xx or 5xx status codes on document parsing failure when accepting application/graphql-response+json', async () => {

@@ -365,2 +385,11 @@ const url = new URL(opts.url);

}),
(0, utils_1.audit)('SHOULD not contain the data entry on document parsing failure when accepting application/graphql-response+json', async () => {
const url = new URL(opts.url);
url.searchParams.set('query', '{');
const res = await fetchFn(url.toString(), {
method: 'GET',
headers: { accept: 'application/graphql-response+json' },
});
(0, utils_1.assert)('Data entry', (await res.json()).data).toBe(undefined);
}),
(0, utils_1.audit)('MUST use 4xx or 5xx status codes on document validation failure when accepting application/graphql-response+json', async () => {

@@ -385,2 +414,13 @@ const url = new URL(opts.url);

}),
(0, utils_1.audit)('SHOULD not contain the data entry on document validation failure when accepting application/graphql-response+json', async () => {
const url = new URL(opts.url);
url.searchParams.set('query', '{ 8f31403dfe404bccbb0e835f2629c6a7 }'); // making sure the field doesnt exist
const res = await fetchFn(url.toString(), {
method: 'GET',
headers: { accept: 'application/graphql-response+json' },
});
(0, utils_1.assert)('Data entry', (await res.json()).data).toBe(undefined);
}),
// TODO: how to fail and have the data entry?
// audit('MUST use 2xx status code if response contains the data entry and it is not null when accepting application/graphql-response+json'),
// TODO: how to make an unauthorized request?

@@ -387,0 +427,0 @@ // https://graphql.github.io/graphql-over-http/draft/#sel-EANNNDTAAEVBAAqqc

13

package.json
{
"name": "graphql-http",
"version": "1.5.0",
"version": "1.6.0",
"description": "Simple, pluggable, zero-dependency, GraphQL over HTTP Protocol compliant server and client",

@@ -27,3 +27,3 @@ "keywords": [

},
"packageManager": "yarn@3.2.2",
"packageManager": "yarn@3.2.3",
"main": "lib/index.js",

@@ -92,10 +92,13 @@ "module": "lib/index.mjs",

"replacestream": "^4.0.3",
"rollup": "^2.78.1",
"rollup": "^2.79.0",
"rollup-plugin-terser": "^7.0.2",
"semantic-release": "^19.0.5",
"tslib": "^2.4.0",
"typedoc": "^0.23.11",
"typedoc-plugin-markdown": "^3.13.4",
"typedoc": "^0.23.13",
"typedoc-plugin-markdown": "^3.13.5",
"typescript": "^4.8.2"
},
"resolutions": {
"npm/libnpmversion": "^3.0.6"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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