Code Monkey home page Code Monkey logo

vulcan-docs's People

Contributors

4t0m avatar amandeepmittal avatar apollinaire avatar ayhid avatar coliff avatar dangerismycat avatar dependabot[bot] avatar derekdreery avatar eloyid avatar eric-burel avatar erikdakoda avatar gwened avatar heldr avatar helfer avatar jamesmillerburgess avatar jefflau avatar justinr1234 avatar kevinashworth avatar klokie avatar lorensr avatar lunchboxer avatar neobii avatar poincare avatar rmarscher avatar sachag avatar startupmill avatar timmikeladze avatar tmeasday avatar witalib avatar xavxyz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vulcan-docs's Issues

Add a "community packages" page

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

tutorial-framework.md#fragments problem

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.
2017-04-24 9 07 48

It seems the fragments not works, the graphql query string is not properly constructed.
2017-04-24 9 13 02

So, what can I do next?

Document non trivial custom mutation

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');

Document how to use arrays with field resolvers

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;
      }
    }
  },

Tutorial recommended packages doesn't work

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)```

Document withMulti2

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.

importing PropTypes

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

VulcanJS Slack link isn't working

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!

autoValue in schema did not work for me

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.

Add documentation about callbacks

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 install is throwing error

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

A possible slight mix up of package names in the docs.

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!

Error in observer.next ...

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!

Movie Example resolveAs Error

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.

typo? in `schemas.md#resolveas`

Thanks for making this repo:+1: I'm trying to go through all the doc.

In schemas.md#resolveas

  1. I did not get 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 your Posts schema, but want this property to resolve as a user object in your GraphQL schema (and in turn, in your client store). You can use resolveAs 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);

should modules include a subdirectory in example-movies?

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:

movies tutorial: graphiql part has a bug

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"
      ]
    }
  ]
}

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.