Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

How to pass variable from local state #328

Open
@pippo111

Description

I have simple Query with variable:

<Query
  pollInterval={2000}
  variables={{ programId: activeProgram }}
  query={FETCH_PROGRAM_EDITOR}
>...

with query:

const FETCH_PROGRAM_EDITOR = gql`
  query ProgramEditor($programId: String!) {
    program(_id: $programId) {
      _id
      name
      desc
    }
  }`

activeProgram is coming from local state (cache). Is there a way to use local state variables directly in query ? How to pass local state to query variable ?

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