Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoverna committed Aug 13, 2024
1 parent 8ed60db commit 3469977
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 31 deletions.
18 changes: 8 additions & 10 deletions src/components/StructuredText/index.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
import { defineComponent, PropType, VNodeProps, VNode, h } from 'vue';
import {
defaultMetaTransformer,
render,
renderNodeRule,
RenderMarkRule,
renderMarkRule,
defaultMetaTransformer,
renderNodeRule,
TransformedMeta,
TransformMetaFn,
RenderMarkRule,
} from 'datocms-structured-text-generic-html-renderer';
import {
Document as StructuredTextDocument,
isBlock,
isInlineItem,
isItemLink,
isRoot,
isStructuredText,
Node,
Record as StructuredTextGraphQlResponseRecord,
Document as StructuredTextDocument,
RenderError,
RenderResult,
RenderRule,
Node,
StructuredText as StructuredTextGraphQlResponse,
isStructuredText,
isRoot,
} from 'datocms-structured-text-utils';
import { defineComponent, h, PropType, VNode, VNodeProps } from 'vue';

export { renderNodeRule, renderMarkRule, RenderError };

// deprecated
export { renderNodeRule as renderRule };

export type { StructuredTextGraphQlResponse, StructuredTextDocument };

type AdapterReturn = VNode | string | null;
Expand Down
45 changes: 24 additions & 21 deletions src/composables/useQuerySubscription/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ Live updates are great both to get instant previews of your content while editin
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Live real-time updates](#live-real-time-updates)
- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Reference](#reference)
- [Initialization options](#initialization-options)
- [Connection status](#connection-status)
- [Error object](#error-object)
- [Example](#example)
- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Reference](#reference)
- [Initialization options](#initialization-options)
- [Connection status](#connection-status)
- [Error object](#error-object)
- [Example](#example)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand All @@ -44,19 +43,23 @@ const {

## Initialization options

| prop | type | required | description | default |
| ------------------ | ------------------------------------------------------------------------------------------ | ------------------ | ------------------------------------------------------------------ | ------------------------------------ |
| enabled | boolean | :x: | Whether the subscription has to be performed or not | true |
| query | string \| [`TypedDocumentNode`](https://github.com/dotansimha/graphql-typed-document-node) | :white_check_mark: | The GraphQL query to subscribe | |
| token | string | :white_check_mark: | DatoCMS API token to use | |
| variables | Object | :x: | GraphQL variables for the query | |
| preview | boolean | :x: | If true, the Content Delivery API with draft content will be used | false |
| environment | string | :x: | The name of the DatoCMS environment where to perform the query | defaults to primary environment |
| initialData | Object | :x: | The initial data to use on the first render | |
| reconnectionPeriod | number | :x: | In case of network errors, the period (in ms) to wait to reconnect | 1000 |
| fetcher | a [fetch-like function](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) | :x: | The fetch function to use to perform the registration query | window.fetch |
| eventSourceClass | an [EventSource-like](https://developer.mozilla.org/en-US/docs/Web/API/EventSource) class | :x: | The EventSource class to use to open up the SSE connection | window.EventSource |
| baseUrl | string | :x: | The base URL to use to perform the query | `https://graphql-listen.datocms.com` |
| prop | type | required | description | default |
| ------------------ | ------------------------------------------------------------------------------------------ | ------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------ |
| enabled | boolean | :x: | Whether the subscription has to be performed or not | true |
| query | string \| [`TypedDocumentNode`](https://github.com/dotansimha/graphql-typed-document-node) | :white_check_mark: | The GraphQL query to subscribe | |
| token | string | :white_check_mark: | DatoCMS API token to use | |
| variables | Object | :x: | GraphQL variables for the query | |
| includeDrafts | boolean | :x: | If true, draft records will be returned | |
| excludeInvalid | boolean | :x: | If true, invalid records will be filtered out | |
| environment | string | :x: | The name of the DatoCMS environment where to perform the query (defaults to primary environment) | |
| contentLink | `'vercel-1'` or `undefined` | :x: | If true, embed metadata that enable Content Link | |
| baseEditingUrl | string | :x: | The base URL of the DatoCMS project | |
| cacheTags | boolean | :x: | If true, receive the Cache Tags associated with the query | |
| initialData | Object | :x: | The initial data to use on the first render | |
| reconnectionPeriod | number | :x: | In case of network errors, the period (in ms) to wait to reconnect | 1000 |
| fetcher | a [fetch-like function](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) | :x: | The fetch function to use to perform the registration query | window.fetch |
| eventSourceClass | an [EventSource-like](https://developer.mozilla.org/en-US/docs/Web/API/EventSource) class | :x: | The EventSource class to use to open up the SSE connection | window.EventSource |
| baseUrl | string | :x: | The base URL to use to perform the query | `https://graphql-listen.datocms.com` |

## Connection status

Expand Down

0 comments on commit 3469977

Please sign in to comment.