Skip to content

Commit 7e211d9

Browse files
authored
Merge pull request #30 from flotiq/feature/add-editor-js-block-graphql-schema
add editor js block graphQL schema
2 parents 119ea10 + 2a6f59c commit 7e211d9

File tree

3 files changed

+54
-11
lines changed

3 files changed

+54
-11
lines changed

gatsby-node.js

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,59 @@ exports.createSchemaCustomization = ({actions}) => {
120120
lat: Float
121121
lon: Float
122122
}
123+
type FlotiqBlock {
124+
time: String
125+
version: String
126+
blocks: [FlotiqBlock2]
127+
}
128+
type FlotiqBlock2 {
129+
id: String
130+
type: String
131+
data: FlotiqBlockData
132+
tunes: FlotiqBlockTunes
133+
}
134+
type FlotiqBlockData {
135+
text: String
136+
level: Float
137+
anchor: String
138+
items: [FlotiqBlockItems]
139+
style: String
140+
url: String
141+
width: String
142+
height: String
143+
fileName: String
144+
extension: String
145+
caption: String
146+
stretched: String
147+
withBorder: String
148+
withBackground: String
149+
message: String
150+
title: String
151+
alignment: String
152+
}
153+
type FlotiqBlockTunes {
154+
alignmentTuneTool: FlotiqBlockAlignementTune
155+
}
156+
type FlotiqBlockAlignementTune {
157+
alignment: String
158+
}
159+
type FlotiqBlockItems {
160+
items: [FlotiqBlockItems]
161+
content: String
162+
}
123163
type FlotiqImageFixed implements Node {
124-
aspectRatio: Float,
125-
width: Float,
126-
height: Float,
127-
src: String,
128-
srcSet: String,
164+
aspectRatio: Float
165+
width: Float
166+
height: Float
167+
src: String
168+
srcSet: String
129169
originalName: String
130170
}
131171
type FlotiqImageFluid implements Node {
132-
aspectRatio: Float,
133-
src: String,
134-
srcSet: String,
135-
originalName: String,
172+
aspectRatio: Float
173+
src: String
174+
srcSet: String
175+
originalName: String
136176
sizes: String
137177
}`);
138178
createTypes(typeDefs);
@@ -340,6 +380,7 @@ const getType = (propertyConfig, required, property, ctdName) => {
340380
case 'email':
341381
case 'radio':
342382
case 'select':
383+
default:
343384
return 'String' + (required ? '!' : '');
344385
case 'number':
345386
return 'Int' + (required ? '!' : '');
@@ -403,5 +444,7 @@ const getType = (propertyConfig, required, property, ctdName) => {
403444
};
404445
case 'object':
405446
return '[' + capitalize(property) + ctdName + ']';
447+
case 'block':
448+
return 'FlotiqBlock'
406449
}
407450
};

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gatsby-source-flotiq",
3-
"version": "2.2.3",
3+
"version": "2.3.0",
44
"keywords": [
55
"flotiq",
66
"gatsby",

0 commit comments

Comments
 (0)