vulcanjs / vulcan-docs Goto Github PK
View Code? Open in Web Editor NEW๐ Docs for React/Apollo/Meteor version of Vulcan
Home Page: http://docs.vulcanjs.org
๐ Docs for React/Apollo/Meteor version of Vulcan
Home Page: http://docs.vulcanjs.org
What do you guys think about adding a page that would list some useful packages developped for vulcan? I'm thinking about stuff like ErikDakoda/vulcan-material-ui that could be useful to some people, but that don't necessarely fit in the main Vulcan repo.
I'm currently developing an app using Vulcan and i will write and maintain public vulcan packages making some integrations easy (for example an Algolia integration package).
Once people share their package to the public, they should be able to add it to the list on the docs to make it easier for people to find it, right?
This is just my point of view, this thread is open for further discussion
Hi,
Before fragments part, the console throw error Error: Fragment "MoviesItemFragment" not registered.
, it is exactly like the doc said:
At this stage, weโll probably get an error message saying the fragment weโre using is not yet defined. To remedy this, create a new fragments.js file inside modules:
After I done the fragments part, I can not get the doc result, but instead a error.
It seems the fragments not works, the graphql query string is not properly constructed.
So, what can I do next?
Example of a non trivial call gracefully provided by @yairtal
Creating a custom server mutation for any use case that is not provided by Vulcan's default mutation is a perfectly normal pattern, yet it's not a reflex because the syntax is not immediate.
Doc could be improved with a non trivial example + a more visible/higher up section about custom mutations and resolvers.
import { addGraphQLMutation, addGraphQLResolvers, Utils } from 'meteor/vulcan:core';
import Users from 'meteor/vulcan:users';
const check = (user, document) => {
if (!user || !document) return false;
return Users.owns(user, document)
? Users.canDo(user, 'post.update.own')
: Users.canDo(user, `post.update.all`);
};
const specificResolvers = {
Mutation: {
addToPostsViewedByIds(root, {postId, userId}, context) {
const document = context.Posts.findOne({_id: postId});
Utils.performCheck(check, context.currentUser, document);
context.Posts.update({_id: postId}, {$addToSet: {viewedByIds: userId}});
return document;
},
},
};
addGraphQLResolvers(specificResolvers);
addGraphQLMutation('addToPostsViewedByIds(postId: String, userId: String) : Post');
In the customization example page, some HTML is broken because of this text: \packages\<package-name>\static\
. The render engine used for the doc does not like the <package-name>
, it thinks it's an html tag and messes up the page, even if it is inside backticks.
https://github.com/VulcanJS/vulcan-docs/edit/master/source/example-customization.md#L59
Perhaps there should be a page talking about the apollo engine dev tools.
register account
apollo client tools
apollo schema:publish --endpoint=http://localhost:3000/graphql --key="service:{your-key}"
A simple example should be helpful, like this:
marketPairs: {
label: "Market Pairs",
type: String,
hidden: true,
optional: true,
canRead: ['guests','members','admin'],
resolveAs: {
fieldName: 'marketPairs',
type: '[MarketPair]',
relation: 'hasMany',
resolver: (coin, args, context) => {
//change to graphql query later
let res = context.MarketPairs.find({left: coin.exchangeSymbol}, {sort: {volume24: -1}, limit: 1}); //find latest aggregate
return res;
}
}
},
http://nova-docs.telescopeapp.org/tutorial-framework.html#Set-Up
W20170130-15:26:12.592(-5)? (STDERR) throw(ex);
W20170130-15:26:12.592(-5)? (STDERR) ^
W20170130-15:26:12.593(-5)? (STDERR)
W20170130-15:26:12.593(-5)? (STDERR) TypeError: Cannot read property 'call' of undefined
W20170130-15:26:12.593(-5)? (STDERR) at getComponent (packages/nova:lib/lib/components.js:52:10)
W20170130-15:26:12.593(-5)? (STDERR) at getRoute (packages/nova:lib/lib/routes.js:48:26)
W20170130-15:26:12.593(-5)? (STDERR) at packages/nova:lib/lib/routes.js:63:20
W20170130-15:26:12.593(-5)? (STDERR) at Array.map (native)
W20170130-15:26:12.594(-5)? (STDERR) at populateRoutesApp (packages/nova:lib/lib/routes.js:60:28)
W20170130-15:26:12.594(-5)? (STDERR) at initNovaRoutesAndApollo (packages/nova:routing/lib/routing.jsx:23:3)
W20170130-15:26:12.594(-5)? (STDERR) at Function.time (/Users/rossfisher/workspaceMeteor/Telescope/.meteor/local/build/programs/server/profile.js:301:28)
W20170130-15:26:12.594(-5)? (STDERR) at /Users/rossfisher/workspaceMeteor/Telescope/.meteor/local/build/programs/server/boot.js:304:13
W20170130-15:26:12.594(-5)? (STDERR) at /Users/rossfisher/workspaceMeteor/Telescope/.meteor/local/build/programs/server/boot.js:345:5
W20170130-15:26:12.594(-5)? (STDERR) at Function.run (/Users/rossfisher/workspaceMeteor/Telescope/.meteor/local/build/programs/server/profile.js:480:12)```
I was trying to use the filters like how it has in the documentation, however only withMulti2 seems to work that way instead of just withMulti so the documentation can reflect that.
React.PropTypes
was moved to its own package since React v15.5, the docs still mention as part of React and the current version of Vulcanjs is depends on React v16.2
It would be good to indicate that the PropTypes should be installed as a separate package.
The mentioned issue come the routing section of the documentation here
I don't think this is a docs issue per se but as I was getting started I was unable to go to the slack resources listed on the index page. I'm assuming something is broken somewhere else or perhaps indeed a link has changed.
Thanks!
I used the autoValue as in the docs for the example-movies:
createdAt: {
type: Date,
viewableBy: ['guests'],
optional: true,
autoValue: (documentOrModifier) => {
if (documentOrModifier && !documentOrModifier.$set) return new Date() // if this is an insert, set createdAt to current timestamp
}
},
but I got createdAt: null
so I used the code from the included package:
onInsert: (document, currentUser) => {
return new Date();
}
which works fine for me. (Why did you pass the args?)
I reset the project with meteor reset but got null again. Not sure if it was a problem with my configuration or a problem with the code.
When you add callbacks, it's unclear that the naming convention for collection hooks are being supplied in lower case which is different than the naming convention of the Type definition which is uppercase.
ie:
modifier = runCallbacks({ name: `movie.update.before`, iterator: data, properties: { document, currentUser }});
const Movies = createCollection({
typeName: "Movie",
schema,
resolvers,
mutations
});
npm http GET https://registry.npmjs.org/hexo-deployer-git
npm http GET https://registry.npmjs.org/handlebars
npm http GET https://registry.npmjs.org/hexo/3.2.0
npm http GET https://registry.npmjs.org/hexo-generator-archive
npm http GET https://registry.npmjs.org/hexo-generator-category
npm http GET https://registry.npmjs.org/hexo-generator-cname
npm http GET https://registry.npmjs.org/hexo-generator-index
npm http GET https://registry.npmjs.org/hexo-generator-tag
npm http GET https://registry.npmjs.org/hexo-renderer-ejs
npm http GET https://registry.npmjs.org/hexo-renderer-less
npm http GET https://registry.npmjs.org/hexo-renderer-marked
npm http GET https://registry.npmjs.org/hexo-server
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/showdown
npm http GET https://registry.npmjs.org/hexo-s3-deploy
npm http 304 https://registry.npmjs.org/hexo-generator-category
npm http 304 https://registry.npmjs.org/hexo-generator-archive
npm ERR! Error: EACCES, mkdir '/home/yogesh/tmp/npm-27070-_Mt8o7ha'
npm ERR! { [Error: EACCES, mkdir '/home/yogesh/tmp/npm-27070-_Mt8o7ha']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/yogesh/tmp/npm-27070-_Mt8o7ha' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.13.0-105-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/yogesh/WebDev/nova-docs
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /home/yogesh/tmp/npm-27070-_Mt8o7ha
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/home/yogesh/tmp/npm-27070-_Mt8o7ha'
npm http 304 https://registry.npmjs.org/handlebars
npm http 304 https://registry.npmjs.org/hexo-deployer-git
npm http 304 https://registry.npmjs.org/hexo/3.2.0
npm http 304 https://registry.npmjs.org/hexo-generator-cname
npm http 304 https://registry.npmjs.org/hexo-generator-index
npm http 304 https://registry.npmjs.org/hexo-generator-tag
npm http 304 https://registry.npmjs.org/hexo-renderer-ejs
npm http 304 https://registry.npmjs.org/hexo-renderer-less
npm http 304 https://registry.npmjs.org/hexo-renderer-marked
npm http 304 https://registry.npmjs.org/hexo-server
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/showdown
npm http 304 https://registry.npmjs.org/hexo-s3-deploy
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/yogesh/WebDev/nova-docs/npm-debug.log
npm ERR! not ok code 0
Adding meta descriptions to the pages could help with SEO
In the tutorial "Understanding the Nova Framework" a package named nova:movies-demo is referred to both at the beginning and at the end of the tutorial.
I suspect that the package is actually named framework-demo.
Thank you very much!
"Customizing & Extending Vulcan" is now linking to http://docs.vulcanjs.org/tutorial-customizing.html, which doesn't exist anymore
Algolia offers docsearch, which is free. Would be nice to have here
Hello,
I'm trying to run the tutorial, "Understanding the Vulcan Framework" but I got stuck after adding the fragments.
The page loads, the list of movies appears but in less than a second the page reloads and I got this error.
Here the stack from the browser console:
Error in observer.next render@http://localhost:3000/packages/my-package.js?hash=46800dd09de94b43efcca733ca33a2f697d0a576:251:13 require<.node_modules["react-dom"].lib["ReactCompositeComponent.js"]</ReactCompositeComponent._renderValidatedComponentWithoutOwnerOrContext/renderedElement<@http://localhost:3000/packages/modules.js?hash=9508cf4817c26a053bc71793130dac2e819df54d:103947:16 measureLifeCyclePerf@http://localhost:3000/packages/modules.js?hash=9508cf4817c26a053bc71793130dac2e819df54d:103226:12 require<.node_modules["react-dom"].lib["ReactCompositeComponent.js"]</ReactCompositeComponent._renderValidatedComponentWithoutOwnerOrContext@http://localhost:3000/packages/modules.js?hash=9508cf4817c26a053bc71793130dac2e819df54d:103946:25 require<.node_modules["react-dom"].lib["ReactCompositeComponent.js"]</ReactCompositeComponent._renderValidatedComponent@http://localhost:3000/packages/modules.js?hash=9508cf4817c26a053bc71793130dac2e819df54d:103973:27 require<.node_modules["react-dom"].lib["ReactCompositeComponent[โฆ] modules.js:21243:37
No errors from the server.
I'm on a Mac Sierra, Meteor 1.4.3.2, npm 4.1.2, node 7.6.0. Any hints?
Thank you guys!
I'm pulling this issue in case anyone else runs into the same Error. The docs for the Field-Resolvers utilize the new resolveAs
Object schema syntax which has not been merged into the master yet. This means you either have to use the old syntax resolveAs: 'user: User'
or you have to use the devel
branch.
Thanks for making this repo:+1: I'm trying to go through all the doc.
userId
, maybe this should be User
in Posts
schema to correspond user
in GraphQL schema?For example, you might have a
userId
(???User) property in yourPosts
schema, but want this property to resolve as auser
object in your GraphQL schema (and in turn, in your client store). You can useresolveAs
to accomplish this:
resolveAs: 'user: User'
2. The `User` and `user` confused me...The below means If I do not use `resolveAs`, but use `GraphQLSchema.addSchema`, all `User` property in `Posts` schema will convert to `User` as GraphQL type.
Do I understand correctly?
>Note that in this case the `User` GraphQL type is generated automatically out of the box since `Users`(???User) is created using `createCollection`, but you could also add it manually:
>```
const userSchema = `
type User {
_id: String
email: String
...
}
`;
>
GraphQLSchema.addSchema(userSchema);
I am going through the example-movies and there is an inconsistency in using the subdirectory movies.
Is your intention to use movies directory? (I think so):
my-package/modules/movies
Or put all the files directly into the modules folder?
As used here:
Weโre now ready to set up our Movies collection. Create a new collection.js file inside modules:
running the following query on the graphiql client:
query moviesQuery{
moviesList{
createdAt
name
}
}
gives the following error:
{
"errors": [
{
"message": "Cannot query field \"moviesList\" on type \"Query\". Did you mean \"MoviesList\", \"usersList\", or \"MoviesSingle\"?",
"locations": [
{
"line": 2,
"column": 3
}
]
}
]
}
When I change the query as suggested into:
query moviesQuery{
MoviesList{
createdAt
name
}
}
I get the following error:
{
"data": {
"MoviesList": null
},
"errors": [
{
"message": "Cannot read property 'offset' of undefined",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"MoviesList"
]
}
]
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.