1.0.26 • Published 3 years ago

@letterdropcom/gatsby-source-letterdrop v1.0.26

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Source plugin for sourcing data from Letterdrop Posts data.

Install

npm i @letterdropcom/gatsby-source-letterdrop

How to use

The plugin requires your publication api-key from Letterdrop. Check here to know how to generate and use an API key.

Once you got your api-key use the following configuration in your Gatsby Site.

# In your gatsby-config.js
plugins: [
    {
        resolve: "@letterdropcom/gatsby-source-letterdrop",
        options: {
            apikey: "<your-api-key>",
            version: "v1" # default version
        }
    }
]

How to query

Upon querying the plugin, it return a single / list of Post nodes. Check the response for the full set of fields made available from Letterdrop Get Post API

Example post query

{
  allLetterdropPosts {
    nodes {
      url
      title
      ...
      coverImage {
        url
        extension
        ...
      }
      publication {
        customDomain {
          domain
          ...
        }
        _id
        domain
      }
      postAuthor {
        _id
        name
      }
    }
  }
}

Example post query with filter

Assume you need to query post url adapt-your-writing from allLetterdropPosts, specify the filter like below

{
  allLetterdropPosts(filter: {url: {eq: "adapt-your-writing"}}) {
    nodes {
      url
      title
      ...
      coverImage {
        url
        extension
        ...
      }
      publication {
        customDomain {
          domain
          ...
        }
        _id
        domain
      }
      postAuthor {
        _id
        name
      }
    }
  }
}

Copyright

Copyright © 2021 Letterdrop

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.23

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

0.1.375

3 years ago

0.1.374

3 years ago

0.1.373

3 years ago

0.1.372

3 years ago

0.1.371

3 years ago

0.1.370

3 years ago

0.1.369

3 years ago