Skip to content

Add initial commit of gatsby-source-lodash plugin. #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 18, 2019

Conversation

zackhall
Copy link
Contributor

To support #201

Re-use docdown lib files to create a source plugin for the new gatsby site. Using this, all the lodash methods should be available via Gatsby GraphQL queries.

The main crux of the code is in the gatsby-node.js file.

All 3 of the lib/* files were ported over from jdalton/docdown library.

Example:

{
  allLodashMethod {
    group(field:category) {
      field
      fieldValue
      totalCount
      edges {
        node {
          id
          name
          category
          aliases
          params {
            type
            name
            desc
          }
          call
        }
      } 
    }
  }
}

Should return something like:

{
  "data": {
    "allLodashMethod": {
      "group": [
        {
          "field": "category",
          "fieldValue": "Array",
          "totalCount": 59,
          "edges": [
            {
              "node": {
                "id": "ee848133-e1b8-56f1-9b0b-801ce2cddc98",
                "name": "compact",
                "category": "Array",
                "aliases": [],
                "params": [
                  {
                    "type": "Array",
                    "name": "array",
                    "desc": "The array to compact."
                  }
                ],
                "call": "compact(array)"
              }
            },
            {
              "node": {
                "id": "74ac71c9-02ce-5183-b690-cb8be9009286",
                "name": "concat",
                "category": "Array",
                "aliases": [],
                "params": [
                  {
                    "type": "Array",
                    "name": "array",
                    "desc": "The array to concatenate."
                  },
                  {
                    "type": "...*",
                    "name": "[values]",
                    "desc": "The values to concatenate."
                  }
                ],
                "call": "concat(array, [values])"
              }
            },
...

@zackhall zackhall requested a review from veksen April 17, 2019 18:17
@jsf-clabot
Copy link

jsf-clabot commented Apr 17, 2019

CLA assistant check
All committers have signed the CLA.

@veksen veksen mentioned this pull request Apr 18, 2019
@veksen veksen merged commit 7c90a8a into lodash:gatsby Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants