Skip to content

Commit

Permalink
Merge pull request #36 from contentstack/hotfix/2.2.4
Browse files Browse the repository at this point in the history
replaced - with _ from contentTypeUid
  • Loading branch information
asmit-patil authored Jun 23, 2020
2 parents 8aa2776 + ac191b5 commit e6f7631
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 e6f7631

Please sign in to comment.