Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
gatsby-source-mesh
Advanced tools
Gatsby source plugin for building websites using the headless CMS Gentics Mesh as a data source.
Source plugin for pulling data into Gatsby from a Gentics Mesh endpoint.
yarn add gatsby-source-mesh
or npm i gatsby-source-mesh
gatsby develop
cd
to the Gatsby install you want to test your changes to the plugin code
with, or clone @gentics/gatsby-mesh-exampleyarn
or npm
, yarn remove gatsby-source-mesh
or npm r gatsby-source-mesh
mkdir plugins
if it does not exist yet and cd
into it~/code/mesh/myKillerGatsbySite/plugins/
git clone https://github.com/gentics/gatsby-source-mesh.git
cd gatsby-source-mesh
yarn
or yarn && yarn watch
in plugin’s directory for auto-rebuilding the
plugin after you make changes to it—only during developmentcd ../.. && yarn && yarn develop
to testIn your gatsby config...
plugins: [
{
resolve: `gatsby-source-mesh`,
options: {
endpoint: `graphql_endpoint`,
token: `graphql_token`,
query: `{
me {
uuid
username
}
nodes {
elements {
uuid
schema {
name
uuid
}
parent {
uuid
}
children {
elements {
uuid
}
}
path
fields {
... on vehicle {
name
description
vehicleImage {
uuid
path
fields {
... on vehicleImage {
image {
width
height
}
}
}
}
}
... on category {
name
slug
description
}
... on vehicleImage {
name
image {
fileName
width
height
}
}
}
}
}
}`,
},
}
],
Gatsby’s data processing layer begins with “source” plugins, configured in gatsby-config.js
.
Here the site sources its data from the Gentics Mesh endpoint.
Use an .env
file or set environment variables directly to access the Gentics Mesh endpoint and token.
This avoids committing potentially sensitive data.
endpoint | Indicates the endpoint to use for the graphql connection. The graphql URL will also be used to select your project. Example: https://demo.getmesh.io/api/v1/demo/graphql |
token | The API access token. By default the anonoymous user will be used. |
query | The GraphQL query to execute against the endpoint. The parent/children properties should always be added otherwise the relationships between the nodes can't be created. Currently only agreggation fields (nodes, users, roles...) can be used. |
This source plugin will load all nodes of Gentics Mesh and transform them into gatsby nodes. If you want to load specific fields of a node you need to adapt the query within your gatsby-config.js
and include the fields.
The aggregation results will not be automatically be paged and thus only the specified amount of elements will be loaded. (default: 25)
You can however increase the page size this way:
{
nodes(perPage: 1000) {
elements {
uuid
}
}
}
Mutlilanguage support has not yet been tested.
You can however load all language variants of a node this way:
{
nodes {
elements {
uuid
languages {
fields {
... on vehicle {
slug
}
}
}
}
}
}
length
must be aliasedIf you have a field named length
it must be aliased to something else like so:
myLength: length
. This is due to internal limitations of Gatsby’s GraphQL
implementation.
This source plugin is a modified fork of the gatsby-source-graphcms plugin.
FAQs
Gatsby source plugin for building websites using the headless CMS Gentics Mesh as a data source.
The npm package gatsby-source-mesh receives a total of 1 weekly downloads. As such, gatsby-source-mesh popularity was classified as not popular.
We found that gatsby-source-mesh demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.