1.2.0 • Published 4 months ago

gatsby-source-personio-xml v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

gatsby-source-personio-xml

Source plugin for pulling data into Gatsby from a Personio XML feed.

Install

npm install --save gatsby-source-personio-xml

or

yarn add gatsby-source-personio-xml

How to use

In gatsby-config.js:

module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-personio-xml`,
      options: {
        url: `https://{username}.jobs.personio.de/xml`,
      },
    },
  ],
};

How to query

You may access the following data node types:

NodeDescription
PersonioPositionThe job postings
PersonioDepartmentThe departments from department field in the XML
PersonioOfficeThe offices from office field in the XML

The field names follow the scheme in the Personio XML feed.

To retrieve a list of all departments with their job postings the following GraphQL query should work:

allPersonioDepartment {
  edges {
    node {
      id
      name
      positions {
        id
        positionId
        recruitingCategory
        office {
          id
          name
        }
        employmentType
        schedule
        seniority
        subcompany
        yearsOfExperience
        name
        jobDescriptions {
          name
          value
        }
      }
    }
  }
}

Adding custom fields

Personio allows you to define custom fields which are not mapped automatically. For these occasions you can customize the XML parsing and GraphQL mapping via the following configuration options:

module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-personio-xml`,
      options: {
        url: `https://{username}.jobs.personio.de/xml`,
        cusomizeXmlMapping: (newNode, xmlNode) => {
          const createdAt = select("string(createdAt)", xmlNode)
          return { ...newNode, createdAt, keywords }
        },
        customizeNodeMapping: (gatsbyNode, originalMappedItem) => {
          return {
            ...gatsbyNode,
            createdAt: originalMappedItem.createdAt,
          }
        },
      },
    },
  ],
};

In addition you will want to define your own Graphql Schema Mapping in your own gatsby-node.js:

exports.createSchemaCustomization = ({ actions }) => {
  const { createTypes } = actions

  createTypes(`
    type PersonioPosition implements Node {
      createdAt: Date
    }
    `)
1.2.0

4 months ago

1.1.1

1 year ago

1.1.0

2 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago