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

@apollo/composition

Package Overview
Dependencies
Maintainers
1
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apollo/composition - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2-alpha.0

30

dist/genHintDoc.js

@@ -6,18 +6,18 @@ "use strict";

const header = `---
title: Federation Hints
sidebar_title: Hints
title: Composition hints
---
When you successfully [compose](./federated-types/composition) the schemas provided by your [subgraphs](./subgraphs/) into a **supergraph schema**, "hints" may provide additional information about the composition. Hints are first and foremost informative and don't necessarily correspond to a problem to be fixed.
When you successfully [compose](./federated-types/composition) the schemas provided by your [subgraphs](./subgraphs/) into a supergraph schema, the composition process might output **hints** that provide additional information about the result. Hints are primarily informative and _do not_ necessarily indicate that a problem needs to be fixed.
Hints are categorized under the following levels:
1. WARN: indicates a situation that may be expected but is usually temporary and should be double-checked. Typically, composition might have had to ignore some elements from some subgraph when creating the supergraph.
2. INFO: information that may hint at some improvements or highlight noteworthy resolution made by composition but can otherwise be ignored.
3. DEBUG: lower-level information that gives insights into the composition but of lesser importance/impact.
* \`WARN\`: Indicates a situation that might be expected but is usually temporary and should be double-checked. Typically, composition might have needed to ignore some elements from some subgraph when creating the supergraph.
* \`INFO\`: Suggests a potentially helpful improvement or highlights a noteworthy resolution made by composition. Can otherwise be ignored.
* \`DEBUG\`: Lower-level information that provides insight into the composition. These hints are of lesser importance/impact.
Note that hints are first and foremost informative and don't necessarily correspond to a problem to be fixed.
This document lists the hints that can be generated for each level, with a description of why they are generated.
This document lists the hints that can be generated for each level, with a description of why each is generated.
`;
function makeMardownArray(headers, rows) {
function makeMarkdownArray(headers, rows) {
const columns = headers.length;

@@ -27,3 +27,3 @@ let out = '| ' + headers.join(' | ') + ' |\n';

for (const row of rows) {
(0, federation_internals_1.assert)(row.length <= columns, `Row [${row}] has too columns (expect ${columns} but got ${row.length})`);
(0, federation_internals_1.assert)(row.length <= columns, `Row [${row}] has too few columns (expect ${columns} but got ${row.length})`);
const frow = row.length === columns

@@ -47,5 +47,3 @@ ? row

rows.sort(sortRowsByCode);
const hintsSectionHeader = `## Hints
The following hints may be generated by composition:`;
const hintsSectionHeader = `The following hints might be generated during composition:`;
const hintsByLevel = [];

@@ -59,9 +57,11 @@ for (const level of [hints_1.HintLevel.WARN, hints_1.HintLevel.INFO, hints_1.HintLevel.DEBUG]) {

const rows = defs.map(def => [
'`' + levelName + '`',
'`' + def.code + '`',
def.description,
'`' + levelName + '`',
]);
hintsByLevel.push(`### ${levelName}`
hintsByLevel.push(`## \`${levelName}\``
+ '\n\n'
+ makeMardownArray(['Level', 'Code', 'Description'], rows));
+ '<div class="sticky-table">\n\n'
+ makeMarkdownArray(['Code', 'Description', 'Level'], rows)
+ '\n</div>');
}

@@ -68,0 +68,0 @@ console.log(header + '\n\n'

{
"name": "@apollo/composition",
"version": "2.0.1",
"version": "2.0.2-alpha.0",
"description": "Apollo Federation composition utilities",

@@ -30,4 +30,4 @@ "main": "dist/index.js",

"dependencies": {
"@apollo/federation-internals": "^2.0.1",
"@apollo/query-graphs": "^2.0.1"
"@apollo/federation-internals": "^2.0.2-alpha.0",
"@apollo/query-graphs": "^2.0.2-alpha.0"
},

@@ -37,3 +37,3 @@ "peerDependencies": {

},
"gitHead": "e38b22c5796b052d1c373291fac93e0d72ee5ec1"
"gitHead": "077f496095196016643728e4829495408b391115"
}

@@ -5,19 +5,19 @@ import { assert, MultiMap } from '@apollo/federation-internals';

const header = `---
title: Federation Hints
sidebar_title: Hints
title: Composition hints
---
When you successfully [compose](./federated-types/composition) the schemas provided by your [subgraphs](./subgraphs/) into a **supergraph schema**, "hints" may provide additional information about the composition. Hints are first and foremost informative and don't necessarily correspond to a problem to be fixed.
When you successfully [compose](./federated-types/composition) the schemas provided by your [subgraphs](./subgraphs/) into a supergraph schema, the composition process might output **hints** that provide additional information about the result. Hints are primarily informative and _do not_ necessarily indicate that a problem needs to be fixed.
Hints are categorized under the following levels:
1. WARN: indicates a situation that may be expected but is usually temporary and should be double-checked. Typically, composition might have had to ignore some elements from some subgraph when creating the supergraph.
2. INFO: information that may hint at some improvements or highlight noteworthy resolution made by composition but can otherwise be ignored.
3. DEBUG: lower-level information that gives insights into the composition but of lesser importance/impact.
* \`WARN\`: Indicates a situation that might be expected but is usually temporary and should be double-checked. Typically, composition might have needed to ignore some elements from some subgraph when creating the supergraph.
* \`INFO\`: Suggests a potentially helpful improvement or highlights a noteworthy resolution made by composition. Can otherwise be ignored.
* \`DEBUG\`: Lower-level information that provides insight into the composition. These hints are of lesser importance/impact.
Note that hints are first and foremost informative and don't necessarily correspond to a problem to be fixed.
This document lists the hints that can be generated for each level, with a description of why they are generated.
This document lists the hints that can be generated for each level, with a description of why each is generated.
`;
function makeMardownArray(
function makeMarkdownArray(
headers: string[],

@@ -30,3 +30,3 @@ rows: string[][]

for (const row of rows) {
assert(row.length <= columns, `Row [${row}] has too columns (expect ${columns} but got ${row.length})`);
assert(row.length <= columns, `Row [${row}] has too few columns (expect ${columns} but got ${row.length})`);
const frow = row.length === columns

@@ -59,6 +59,4 @@ ? row

const hintsSectionHeader = `## Hints
const hintsSectionHeader = `The following hints might be generated during composition:`;
The following hints may be generated by composition:`;
const hintsByLevel = [];

@@ -74,12 +72,12 @@

const rows = defs.map(def => [
'`' + levelName + '`',
'`' + def.code + '`',
def.description,
'`' + levelName + '`',
]);
hintsByLevel.push(`### ${levelName}`
hintsByLevel.push(`## \`${levelName}\``
+ '\n\n'
+ makeMardownArray(
[ 'Level', 'Code', 'Description' ],
rows,
));
+ '<div class="sticky-table">\n\n'
+ makeMarkdownArray([ 'Code', 'Description', 'Level' ], rows)
+ '\n</div>'
);
}

@@ -92,2 +90,1 @@

);

Sorry, the diff of this file is not supported yet

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