4.0.4 • Published 3 years ago

@apollo-elements/lib v4.0.4

Weekly downloads
80
License
ISC
Repository
github
Last release
3 years ago

@apollo-elements/lib

Published on npm ISC License Release

Helper functions for Apollo Elements

🔎 Read the Full API Docs 🔎

createApolloClient

Creates a simple ApolloClient instance given a URI and some params.

createApolloClient({
  uri: '/graphql',
  typePolicies: {
    User: {
      fields: {
        fullName(_, { readField }) {
          return `${readField('firstName')} ${readField('lastName')}`;
        }
      }
    }
  }
});

hasAllVariables

Predicate that validates a GraphQL request (a DocumentNode and a variables object) as having all of its required (i.e. non-nullable) variables defined.

function hasAllVariables(params: { query: DocumentNode, variables: any }): boolean

isClientOperation

Predicate that validates a DocumentNode as being an exclusively client-side operation, i.e. all of it's requests are modified by a @client directive.

function isClientOperation(operation: Operation): boolean

isValidGql

Predicate that validates an object as a DocumentNode.

function isValidGql(document: DocumentNode | any): boolean
4.0.4-alpha.0

3 years ago

4.0.4

3 years ago

4.0.3

3 years ago

4.0.2

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

4.0.0-alpha.0

3 years ago

3.5.0-alpha.1

3 years ago

3.5.0-alpha.0

3 years ago

3.4.0

3 years ago

3.3.0

4 years ago

3.2.0

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

3.0.0-alpha.5

4 years ago

3.0.0-alpha.4

4 years ago

2.0.1-alpha.0

4 years ago

3.0.0-alpha.3

4 years ago

3.0.0-alpha.2

4 years ago

3.0.0-alpha.0

4 years ago

2.0.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.6

5 years ago

0.0.4

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago