+
diff --git a/wp-blocks/AcfGraphqlQuery.js b/wp-blocks/AcfGraphqlQuery.js
new file mode 100644
index 0000000..92d5afe
--- /dev/null
+++ b/wp-blocks/AcfGraphqlQuery.js
@@ -0,0 +1,33 @@
+import { gql } from '@apollo/client';
+import { getGraphqlEndpoint } from '@faustwp/core';
+import React from 'react';
+
+import { MiniGraphQL } from '@/components/MiniGraphQL';
+
+export function AcfGraphqlQuery({ graphqlQueryBlockMeta }) {
+ const { query, variables } = graphqlQueryBlockMeta;
+
+ return (
+
+ );
+}
+
+AcfGraphqlQuery.displayName = 'AcfGraphqlQuery';
+AcfGraphqlQuery.config = {
+ name: 'AcfGraphqlQuery',
+};
+AcfGraphqlQuery.fragments = {
+ key: 'AcfGraphqlQueryFragment',
+ entry: gql`
+ fragment AcfGraphqlQueryFragment on AcfGraphqlQuery {
+ graphqlQueryBlockMeta {
+ query
+ variables
+ }
+ }
+ `,
+};
diff --git a/wp-blocks/CoreHeading.js b/wp-blocks/CoreHeading.js
index 7498556..d6f052b 100644
--- a/wp-blocks/CoreHeading.js
+++ b/wp-blocks/CoreHeading.js
@@ -2,7 +2,7 @@ import { CoreBlocks } from '@faustwp/blocks'
import slugify from '@sindresorhus/slugify'
const { CoreHeading: FaustCoreHeading } = CoreBlocks
-function Component(props) {
+export function CoreHeading(props) {
const { attributes } = props
const customAttributes = {
@@ -19,8 +19,6 @@ function Component(props) {
)
}
-Component.displayName = { ...FaustCoreHeading.displayName }
-Component.config = { ...FaustCoreHeading.config }
-Component.fragments = { ...FaustCoreHeading.fragments }
-
-export default Component
+CoreHeading.displayName = { ...FaustCoreHeading.displayName }
+CoreHeading.config = { ...FaustCoreHeading.config }
+CoreHeading.fragments = { ...FaustCoreHeading.fragments }
diff --git a/wp-blocks/index.js b/wp-blocks/index.js
index 6595f95..cde7480 100644
--- a/wp-blocks/index.js
+++ b/wp-blocks/index.js
@@ -1,12 +1,14 @@
import { CoreBlocks } from '@faustwp/blocks'
import { AcfFieldTypeSettingsBlock } from './AcfFieldTypeSettingsBlock'
-import CustomHeading from './CoreHeading'
+import { AcfGraphqlQuery } from './AcfGraphqlQuery'
+import { CoreHeading } from './CoreHeading'
const blocks = {
...CoreBlocks,
- CoreHeading: CustomHeading,
+ CoreHeading,
AcfFieldTypeSettingsBlock,
+ AcfGraphqlQuery,
}
export default blocks
diff --git a/wp-templates/single-field_type.js b/wp-templates/single-field_type.js
index 102f386..b916d7f 100644
--- a/wp-templates/single-field_type.js
+++ b/wp-templates/single-field_type.js
@@ -6,7 +6,8 @@ import { Separator } from '@radix-ui/react-separator'
import { Layout } from '@/components/Layout'
import { Badge } from '@/components/ui/badge'
import blocks from '@/wp-blocks'
-import { AcfFieldTypeSettingsBlock } from '@/wp-blocks/AcfFieldTypeSettingsBlock';
+import { AcfFieldTypeSettingsBlock } from '@/wp-blocks/AcfFieldTypeSettingsBlock'
+import { AcfGraphqlQuery } from '@/wp-blocks/AcfGraphqlQuery'
export const SingleFieldType = ({ data }) => {
const { node } = data
@@ -110,6 +111,7 @@ query SingleAcfFieldType($uri: String!) {
...${blocks.CoreList.fragments.key}
...${blocks.CoreHeading.fragments.key}
...AcfFieldTypeSettingsBlockFragment
+ ...AcfGraphqlQueryFragment
}
}
...aCFFieldTypeCategoriesFragment
@@ -118,6 +120,7 @@ query SingleAcfFieldType($uri: String!) {
${Layout.fragment}
${aCFFieldTypeCategoriesFragment}
${AcfFieldTypeSettingsBlock.fragments.entry}
+${AcfGraphqlQuery.fragments.entry}
${blocks.CoreParagraph.fragments.entry}
${blocks.CoreColumns.fragments.entry}