How to use packages that depend on Node.js core modules in React Native.
See the [node-libs-react-native][node-libs-react-native] library as a convenience for implementing this method.
import gql from 'graphql-tag' | |
import { client } from '../utils/apollo-client' | |
const { parse } = wp.blocks; | |
const { select, subscribe, dispatch } = wp.data; | |
const GET_PAGE_BLOCK_TEMPLATE = gql` | |
query GET_PAGE_BLOCK_TEMPLATE($id: ID!, $template: String) { | |
page( id: $id ) { | |
blockTemplate( pageTemplate: $template ) | |
} | |
} |