steveb
11/07/2017, 4:03 PMmutation
{
addToUserOnBlog(usersUserId: "cj9ohpnok00zw01196umznk21" blogsBlogId: "cj9og4mlg0ubw0105dtukhnm2") {
# we don't need this but we need to return something
usersUserId {
id
}
}
}
daniele
11/07/2017, 4:44 PMdanaszova
11/07/2017, 5:13 PMsteveb
11/07/2017, 6:56 PMmike.johnson
11/07/2017, 7:14 PMamann
11/07/2017, 7:38 PMsecret
field on the file node type? Is it something I should be assigning a UUID?shane.bruggeman
11/07/2017, 7:45 PMshane.bruggeman
11/07/2017, 7:45 PMmarkmiller21
11/07/2017, 7:50 PMorr
11/07/2017, 9:05 PMbirkir
11/07/2017, 9:12 PMkimf
11/07/2017, 9:30 PMTerminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: fetch is not found globally and no fetcher passed, to fix pass a fetch for
your environment like <https://www.npmjs.com/package/node-fetch>.
For example:
import fetch from 'node-fetch';
import { createHttpLink } from 'apollo-link-http';
const link = createHttpLink({ uri: '/graphql', fetch: fetch });
(/var/containers/Bundle/Application/7ECC8570-078D-4115-98CB-3FDCAC270867/Tisdagsgolfen.app/main.jsbundle:344)', reason: 'Unhandled JS Exception: fetch is not found globally and no fetcher passed, ...'
cole
11/07/2017, 9:49 PM'<https://api.graph.cool/simple/v1/apollo-engine-demo-posts>'
query {
allFiles {
contentType
createdAt
id
name
secret
}
}
{
"data": {
"allFiles": []
}
}
amann
11/07/2017, 10:04 PMfalconerd
11/07/2017, 11:24 PMgraphcool/graphql-cli
and graphcool/framework
?falconerd
11/07/2017, 11:24 PMfalconerd
11/07/2017, 11:25 PMMingzhou ZHUANG
11/08/2017, 1:44 AMMingzhou ZHUANG
11/08/2017, 2:30 AMgo4cas
11/08/2017, 8:34 AMrick
11/08/2017, 9:35 AMmutation CreateUserMutation($viewedVideoVideoId: ID!, $viewedByUserId: ID!) {
addToViewedVideos(
viewedVideoVideoId: $viewedVideoVideoId,
viewedByUserId: $viewedByUserId
) {
viewedByUser {
id
}
}
}`
and the following types.grapql
type User @model {
# Required system field:
id: ID! @isUnique # read-only (managed by Graphcool)
# Optional system fields (remove if not needed):
createdAt: DateTime! # read-only (managed by Graphcool)
updatedAt: DateTime! # read-only (managed by Graphcool)
facebookUserId: String @isUnique
email: String # optional, because it's obtained from Facebook API
name: String # optional, because it's obtained from Facebook API
viewedVideos: [Video!]! @relation(name: "viewedVideos")
}
# Uncomment the model below as well
type Video @model {
id: ID! @isUnique # read-only (managed by Graphcool)
createdAt: DateTime! # read-only (managed by Graphcool)
updatedAt: DateTime! # read-only (managed by Graphcool)
videoId: Int @isUnique
# Every relation also required a back-relation (to determine 1:1, 1:n or n:m)
viewedByUsers: [User!]! @relation(name: "viewedVideos")
}
Implementing the counter is pretty straightforward now, the only thing that I’m not sure about is storing the user progress per video in a smart way, I probably want to store it on the user, but I’m not sure what’s the best way. I want to be able to send the videoId
to retrieve the progress and I’m not sure if that possible if I save the watch history as a JSON like {"1231": 0.8}
. Any advice would be much appreciated!Pieter
11/08/2017, 9:49 AMPieter
11/08/2017, 9:49 AMfrankspin
11/08/2017, 10:08 AMjohhansantana
11/08/2017, 1:26 PMcameronrll
11/08/2017, 1:31 PMemils
11/08/2017, 1:32 PMmeikoudras
11/08/2017, 1:33 PMnilan
11/08/2017, 1:35 PMMiezan
11/08/2017, 2:29 PMconst httpLink = new HttpLink({
uri: SIMPLE_API_ENDPOINT
});
it seems like no matter what i pass to the apollo client gets ignored and i get <http://localhost:3000/graphql> 404 (Not Found)
, anyone else having this issue?