Skip to content
This repository was archived by the owner on Dec 25, 2022. It is now read-only.
This repository was archived by the owner on Dec 25, 2022. It is now read-only.

How does it discover individual objects? #40

Open
@dbx834

Description

@dbx834

Hello... Thanks for making this package, it's really useful. I was looking at the code and was wondering how does it discover individual objects given an endpoint?

Suppose there are these two books that the API publishes data on,

https://api.example.com/json/books/1
https://api.example.com/json/books/2

Given a configuration,

{
  resolve: 'gatsby-source-custom-api',
  options: {
    url: 'https://api.example.com/json',
    imageKeys: ['images'],
    rootKey: 'books',
    schemas: {
      book: `
        id: Int
        title: String
        isbn: String
      `,
    },
  },
}

How does it discover the two objects? I wasn't able to make it out from the codebase. If you think this might be also useful for others, maybe it can be added in the documentation. If I'm able to understand it, I'll contribute a PR. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions