Skip to content
Permalink
Browse files

fix(form-builder): make sure apollo is initialized properly

  • Loading branch information...
anehx committed Jul 9, 2019
1 parent c66ffa2 commit 8496daac49513065900f880144743cc303baa17a
Showing with 8 additions and 10 deletions.
  1. +2 −4 addon/components/cfb-form-editor/question/validation.js
  2. +6 −6 addon/services/validator.js
@@ -1,15 +1,13 @@
import Component from "@ember/component";
import { computed } from "@ember/object";
import { inject as service } from "@ember/service";
import { task } from "ember-concurrency";
import layout from "../../../templates/components/cfb-form-editor/question/validation";
import { ComponentQueryManager } from "ember-apollo-client";
import allFormatValidatorsQuery from "ember-caluma/gql/queries/all-format-validators";

export default Component.extend({
export default Component.extend(ComponentQueryManager, {
layout,

apollo: service(),

init() {
this._super(...arguments);

@@ -1,16 +1,16 @@
import Service from "@ember/service";
import { task } from "ember-concurrency";
import { inject as service } from "@ember/service";
import allFormatValidatorsQuery from "ember-caluma/gql/queries/all-format-validators";
import { computed } from "@ember/object";
import { assert } from "@ember/debug";
import { ObjectQueryManager } from "ember-apollo-client";
import { next } from "@ember/runloop";

export default Service.extend({
apollo: service(),

export default Service.extend(ObjectQueryManager, {
init() {
this._super(...arguments);
this._fetchValidators.perform();

next(this._fetchValidators, "perform");
},

/**
@@ -42,7 +42,7 @@ export default Service.extend({
},

_fetchValidators: task(function*() {
return yield this.get("apollo").query(
return yield this.apollo.query(
{ query: allFormatValidatorsQuery },
"allFormatValidators.edges"
);

0 comments on commit 8496daa

Please sign in to comment.
You can’t perform that action at this time.