Giter Club home page Giter Club logo

meteor-blaze-apollo-example's People

Contributors

mpowaga avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

rwatts3

meteor-blaze-apollo-example's Issues

subscription.refetch is not a function

OS Win 7 32bit
meteor 1.4.2
FlowRouter 2.12.1

Hi,

I am using the Meteor Example App: Simple Todos as the start point for this app (proof of concept).

It works the first time I visit the url/path e.g. http://localhost:3000/jobs/27124 but everytime I do FlowRouter.go('/jobs/<jobId>) to trigger another refresh. I get the error below.

Exception from Tracker recompute function:
debug.js:41 TypeError: subscription.refetch is not a function
    at refetch (blaze-apollo.js:31)
    at Blaze.View.<anonymous> (blaze-apollo.js:20)
    at view.js:199
    at Function.Template._withTemplateInstanceFunc (template.js:465)
    at view.js:197
    at Object.Blaze._withCurrentView (view.js:538)
    at viewAutorun (view.js:196)
    at Tracker.Computation._compute (tracker.js:311)
    at Tracker.Computation._recompute (tracker.js:330)
    at Object.Tracker._runFlush (tracker.js:495)

(There may be a few bugs I have not encountered in the code).

Sample code...

Template.Jobs_show_page.onCreated(function jobsShowPageOnCreated() {
  this.getJobId = () => FlowRouter.getParam('_id');
  
  const instance = Template.instance();
  instance._id = new ReactiveVar(this.getJobId());
});

Template.Jobs_show_page.helpers({
  jobIdArray() {
    const instance = Template.instance();
    const jobId = instance.getJobId();
    instance._id.set(jobId);
    return instance.findJob() ? [jobId] : [];
  },
  jobArgs(jobId) {
    const instance = Template.instance();
    // By finding the job with only the `_id` field set, we don't create a dependency on the
    // `job.incompleteCount`, and avoid re-rendering the todos when it changes
    const job = instance.findJob();
    return {
      todosReady: instance.subscriptionsReady(),
      job() {
        return instance.findJob().JOB;
      },
    };
  },
  job() {
    return Template.instance().findJob().JOB;
  }

});

Let me know if you can help or if you need more info.

Update

I have tracked down the issue to blaze-apollo#L31

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.