Skip to content

Commit

Permalink
Update composedb.js
Browse files Browse the repository at this point in the history
  • Loading branch information
serefyarar committed May 21, 2024
1 parent cc122dc commit c2ba7e5
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions api/src/libs/composedb.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,18 +290,20 @@ export const jsonSchemaToGraphQLFragment = (schema, prefix = false) => {
const parentDefs = schema.schema.$defs;
const prefixName = schema.name;

schema.schema.$defs.GraphQLDID = {
type: "object",
title: "GraphQLDID",
required: ["id"],
properties: {
id: {
type: "string",
maxLength: 100,
if (schema.schema.$defs) {
schema.schema.$defs.GraphQLDID = {
type: "object",
title: "GraphQLDID",
required: ["id"],
properties: {
id: {
type: "string",
maxLength: 100,
},
},
},
additionalProperties: false,
};
additionalProperties: false,
};
}

schema.schema.properties.id = {
type: "string",
Expand Down Expand Up @@ -415,12 +417,12 @@ export const setIndexedModelParams = async (app) => {
const modelFragments = await Promise.all(
modelList.map(async (m) => {
const stream = await ceramic.loadStream(m);
//const fragment = jsonSchemaToGraphQLFragment(stream.content);
const fragment = jsonSchemaToGraphQLFragment(stream.content);
return {
id: m,
name: stream.content.name,
//fragment,
//prefixedFragment: jsonSchemaToGraphQLFragment(stream.content, true),
fragment,
prefixedFragment: jsonSchemaToGraphQLFragment(stream.content, true),
};
}),
);
Expand Down

0 comments on commit c2ba7e5

Please sign in to comment.