Class Mixins: GraphQLScriptChildMixin
GraphQLScriptChildMixin
allows Apollo elements to read their GraphQL document (i.e. query, mutation, or subscription) and variables from HTML <script type="application/graphql">
or <script type="application/json">
elements
Signature
GraphQLScriptChildMixin
Parameters
superclass
B
Private API
Private Properties
mo
MutationObserver | undefined
Updates the element state in reaction to GraphQL or JSON script child changes.
Private Methods
parseVariables
Parameters
text
string
Returns
this['variables']
parseGQL
Parameters
text
string
Returns
this['document']
onDOMMutation
Update the element state in reaction to DOM updates that change the declarative GraphQL document or JSON-variable scripts
Parameters
records
MutationRecord[]
Returns
void
matchNode
When encountering a DOM Mutation, update the element's state if relevant.
Parameters
node
Node
Returns
Promise<void>
getDOMVariables
Gets operation variables from the element's JSON script child
Returns
this['variables']
getDOMGraphQLDocument
Get a GraphQL DocumentNode from the element's GraphQL script child
Returns
Promise<this['document']>
fetchDocument
Parameters
url
string
Returns
Promise<this['document']>
Exports
import { GraphQLScriptChildMixin } from '@apollo-elements/mixins/graphql-script-child-mixin';