Skip to content

Commit

Permalink
replaced - with _ from contentTypeUid
Browse files Browse the repository at this point in the history
  • Loading branch information
asmit-patil committed Jun 23, 2020
1 parent 8aa2776 commit ac191b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ exports.createSchemaCustomization = function () {
createTypes = actions.createTypes;

contentTypes.forEach(function (contentType) {
var name = typePrefix + '_' + contentType.uid;
var contentTypeUid = contentType.uid.replace(/-/g, '_');
var name = typePrefix + '_' + contentTypeUid;
var result = buildCustomSchema(contentType.schema, [], name, typePrefix);
if ((0, _keys2.default)(result.references).length === 0) {
var typeDefs = ['type linktype{\n title: String\n href: String\n }', schema.buildObjectType({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gatsby-source-contentstack",
"version": "2.2.3",
"version": "2.2.4",
"description": "Gatsby source plugin for building websites using Contentstack as a data source",
"scripts": {
"prepublish": "npm run build",
Expand Down
3 changes: 2 additions & 1 deletion src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ exports.createSchemaCustomization = async ({
createTypes,
} = actions;
contentTypes.forEach((contentType) => {
const name = `${typePrefix}_${contentType.uid}`;
const contentTypeUid = ((contentType.uid).replace(/-/g, '_'));
const name = `${typePrefix}_${contentTypeUid}`;
const result = buildCustomSchema(contentType.schema, [], name, typePrefix);
if (Object.keys(result.references).length === 0) {
const typeDefs = [
Expand Down

0 comments on commit ac191b5

Please sign in to comment.