Skip to content
This repository was archived by the owner on Jul 6, 2020. It is now read-only.
This repository was archived by the owner on Jul 6, 2020. It is now read-only.

Directive composition #152

@JoviDeCroock

Description

@JoviDeCroock

Idea

Related to #146 I'd like to extend our traverser to have a certain set of directives like the one proposed in the issue @extra. When passed to the cacheExchange it would automatically stop at these directives, strip them out and execute a callback allowing you to return an altered operation, ....

This would for example allow you to add more variables, allow the populateExchange to become a HOC passed into this object.

Rough example

cacheExchange({
  directives: {
    extra: (op, directiveArgs) => ({ ....op, variables: { ...op.variables, ...directiveArgs }}) 
  }
})

This is very rough and I'll most likely alter this when hacking on it but I would like to send this in to get some more idea's

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions