gatsby-source-contentchef

0.5.0 • Public • Published

Usage

plugins: [{
  resolve: 'gatsby-source-contentchef',
  options: {
    apiKey: 'your api key',
    spaceId: 'your space',
    channel: 'your channel',
    host?: 'contentchef endpoint',
    queries: [query1, query2] // needed to retrieve the content/s you want
  }
}]
interface Query {
  id: string;
  publicId?: string[] | string;
  contentDefinition?: string[] | string;
  repositories?: string[];
  legacyMetadata?: boolean;
  tags?: string[] | string;
  propFilters?: IPropFilter;
  sorting?: ISortingField[] | string;
}

interface IPropFilter {
  condition: LogicalOperators;
  items: IPropFilterItem[];
}

interface IPropFilterItem {
  field: string;
  operator: Operators;
  value: any;
}

enum LogicalOperators {
  AND = 'AND',
  OR = 'OR',
}

enum Operators {
  CONTAINS = 'CONTAINS',
  CONTAINS_IC = 'CONTAINS_IC',
  EQUALS = 'EQUALS',
  EQUALS_IC = 'EQUALS_IC',
  IN = 'IN',
  IN_IC = 'IN_IC',
  STARTS_WITH = 'STARTS_WITH',
  STARTS_WITH_IC = 'STARTS_WITH_IC',
}

interface ISortingField {
  fieldName: 'publicId' | 'onlineDate' | 'offlineDate' | string;
  ascending: boolean;
}

Package Sidebar

Install

npm i gatsby-source-contentchef

Weekly Downloads

1

Version

0.5.0

License

MIT

Unpacked Size

27.4 kB

Total Files

10

Last publish

Collaborators

  • bcoders