How to use @graphql-inspector/core - 10 common examples

To help you get started, we’ve selected a few @graphql-inspector/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kamilkisiela / graphql-inspector / packages / cli / __tests__ / render.ts View on Github external
test('render breaking', () => {
  const change: Change = {
    criticality: {
      level: CriticalityLevel.Breaking,
    },
    type: ChangeType.TypeRemoved,
    message: 'Boom, breaking',
    path: 'Type.field',
  };

  const [symbol, msg] = renderChange(change);

  expect(symbol).toBeDefined();
  expect(symbol).toEqual(getSymbol(CriticalityLevel.Breaking));

  expect(msg).toBeDefined();
  expect(msg).toEqual(change.message);
});
github kamilkisiela / graphql-inspector / packages / cli / __tests__ / render.ts View on Github external
test('render breaking', () => {
  const change: Change = {
    criticality: {
      level: CriticalityLevel.Breaking,
    },
    type: ChangeType.TypeRemoved,
    message: 'Boom, breaking',
    path: 'Type.field',
  };

  const [symbol, msg] = renderChange(change);

  expect(symbol).toBeDefined();
  expect(symbol).toEqual(getSymbol(CriticalityLevel.Breaking));

  expect(msg).toBeDefined();
  expect(msg).toEqual(change.message);
});
github kamilkisiela / graphql-inspector / packages / cli / __tests__ / render.ts View on Github external
test('bold', () => {
  const change: Change = {
    criticality: {
      level: CriticalityLevel.Dangerous,
    },
    type: ChangeType.TypeDescriptionChanged,
    message: `Type 'Foo' changed its name to 'Bar'.`,
    path: 'Type.field',
  };

  const [, msg] = renderChange(change);

  expect(msg).toEqual(
    `Type ${chalk.bold('Foo')} changed its name to ${chalk.bold('Bar')}.`,
  );
});
github kamilkisiela / graphql-inspector / packages / cli / __tests__ / render.ts View on Github external
test('render dangerous', () => {
  const change: Change = {
    criticality: {
      level: CriticalityLevel.Dangerous,
    },
    type: ChangeType.TypeRemoved,
    message: 'Ooo dangerous...',
    path: 'Type.field',
  };

  const [symbol, msg] = renderChange(change);

  expect(symbol).toBeDefined();
  expect(symbol).toEqual(getSymbol(CriticalityLevel.Dangerous));

  expect(msg).toBeDefined();
  expect(msg).toEqual(change.message);
});
github kamilkisiela / graphql-inspector / packages / cli / __tests__ / render.ts View on Github external
test('render dangerous', () => {
  const change: Change = {
    criticality: {
      level: CriticalityLevel.Dangerous,
    },
    type: ChangeType.TypeRemoved,
    message: 'Ooo dangerous...',
    path: 'Type.field',
  };

  const [symbol, msg] = renderChange(change);

  expect(symbol).toBeDefined();
  expect(symbol).toEqual(getSymbol(CriticalityLevel.Dangerous));

  expect(msg).toBeDefined();
  expect(msg).toEqual(change.message);
});
github kamilkisiela / graphql-inspector / packages / cli / __tests__ / render.ts View on Github external
test('render non-breaking', () => {
  const change: Change = {
    criticality: {
      level: CriticalityLevel.NonBreaking,
    },
    type: ChangeType.TypeRemoved,
    message: 'Chill, non breaking',
    path: 'Type.field',
  };

  const [symbol, msg] = renderChange(change);

  expect(symbol).toBeDefined();
  expect(symbol).toEqual(getSymbol(CriticalityLevel.NonBreaking));

  expect(msg).toBeDefined();
  expect(msg).toEqual(change.message);
});
github kamilkisiela / graphql-inspector / packages / cli / __tests__ / render.ts View on Github external
test('render non-breaking', () => {
  const change: Change = {
    criticality: {
      level: CriticalityLevel.NonBreaking,
    },
    type: ChangeType.TypeRemoved,
    message: 'Chill, non breaking',
    path: 'Type.field',
  };

  const [symbol, msg] = renderChange(change);

  expect(symbol).toBeDefined();
  expect(symbol).toEqual(getSymbol(CriticalityLevel.NonBreaking));

  expect(msg).toBeDefined();
  expect(msg).toEqual(change.message);
});
github kamilkisiela / graphql-inspector / packages / cli / __tests__ / render.ts View on Github external
test('render non-breaking', () => {
  const change: Change = {
    criticality: {
      level: CriticalityLevel.NonBreaking,
    },
    type: ChangeType.TypeRemoved,
    message: 'Chill, non breaking',
    path: 'Type.field',
  };

  const [symbol, msg] = renderChange(change);

  expect(symbol).toBeDefined();
  expect(symbol).toEqual(getSymbol(CriticalityLevel.NonBreaking));

  expect(msg).toBeDefined();
  expect(msg).toEqual(change.message);
});
github kamilkisiela / graphql-inspector / packages / cli / __tests__ / render.ts View on Github external
test('render dangerous', () => {
  const change: Change = {
    criticality: {
      level: CriticalityLevel.Dangerous,
    },
    type: ChangeType.TypeRemoved,
    message: 'Ooo dangerous...',
    path: 'Type.field',
  };

  const [symbol, msg] = renderChange(change);

  expect(symbol).toBeDefined();
  expect(symbol).toEqual(getSymbol(CriticalityLevel.Dangerous));

  expect(msg).toBeDefined();
  expect(msg).toEqual(change.message);
});
github kamilkisiela / graphql-inspector / packages / cli / __tests__ / render.ts View on Github external
test('bold', () => {
  const change: Change = {
    criticality: {
      level: CriticalityLevel.Dangerous,
    },
    type: ChangeType.TypeDescriptionChanged,
    message: `Type 'Foo' changed its name to 'Bar'.`,
    path: 'Type.field',
  };

  const [, msg] = renderChange(change);

  expect(msg).toEqual(
    `Type ${chalk.bold('Foo')} changed its name to ${chalk.bold('Bar')}.`,
  );
});