-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various and Sundries Questions #36
Comments
ping @bgentry |
You should put the import ProfileDetailQuery from '<project-name>/gql/queries/statistics-profile/profile-detail-query';
import ProfilePreviewQuery from '<project-name>/gql/queries/statistics-profile/profile-preview-query'; The api is not like the react api, I would love to see this library to be more like the react implementation. import Ember from 'ember';
import Component from 'ember-component';
import injectService from 'ember-service/inject';
import get from 'ember-metal/get';
import set from 'ember-metal/set';
const {
ObjectProxy,
PromiseProxyMixin,
} = Ember;
const PromiseObject = ObjectProxy.extend(PromiseProxyMixin);
export default Component.extend({
// computed state
isLoadingProfileDetail: computed.bool(`singleProfileDetailQuery.isPending`),
initSingleProfileDetailQuery() {
const singleProfileId = get(this, `singleProfileId`);
const apollo = get(this, `apollo`);
const singleProfilePreviewQueryPromise = apollo.query({
query: SingleProfileDetailQuery,
variables: { singleProfileId },
});
const singleProfileDetailQuery = PromiseObject.create({ promise: singleProfilePreviewQueryPromise });
set(this, `singleProfileDetailQuery`, singleProfileDetailQuery);
},
// ...
}) |
Thanks for the information!
|
@DevanB Regarding 2: I am pretty sure those are from apollo-client, but they seem not to be exposed by apollo-ember-client. |
Correct, they are |
Inside your
There's a open issue discussing pagination and a work in progress on it that I guess is almost ready to be merged. I'm using it on my app. There's no work in progress on subscriptions yet.
The You can use
I guess not. Maybe you can try it with Ember Concurrency addon. |
@viniciussbs Thanks for the response! I'm excited to see pagination added :) |
Hey there!
I'd like to start off by saying that this looks to be the most feature complete, maintained Apollo integration for Ember, so thank you very much for this!
I am writing a tutorial for How To GraphQL on building a simple HackerNews clone using Ember+Apollo, and I am using this integration. Unfortunately, I do have a few questions. I'd love to join a Slack channel, Discord channel, or whatever where I can stay in contact if that is available. In the case that it isn't, I'll include some questions below:
Where is the suggested location for adding the
gql/queries
folder, and what is the suggested import for a single query in thatqueries
folder? I only ask these questions because I have been unable to get it to work. I sidestepped this by importinggql
fromgraphql-tag
and wrote the query in-line, which works perfectly.Any news on subscriptions and pagination? I'd love to include these in the tutorial, but the best answer I can find (after looking through outstanding issues) seems to be that it is a WIP. I'm completely fine noting this in my tutorial, and already have approval to do that. If that were to happen, I'd love to keep in touch and continually update the tutorial when updates are released to this wonderful integration.
What are the implications of not using the
UnsubscribeRoute
mixin? I ask because I would prefer not to use and explain it in the tutorial if the performance loss is minimal. An alternative question is how you can explicitly usequery
instead ofwatchQuery
?Are the
error
andloading
states that Apollo returns available? I'd love to easily show a "Loading..." message or error message if they are available.I might have some more questions, but for now, that is all. Thanks so much for this fine integration!
The text was updated successfully, but these errors were encountered: