-
Notifications
You must be signed in to change notification settings - Fork 425
Guidelines for package authors #28
Comments
Wow this is a great idea! Can we get a list going of possible types of packages? I think that would help me think about the various guidelines that would be helpful! |
Glad it was well received. For an exhaustive list of examples you can: $ echo "SELECT DISTINCT(packageName) FROM versions WHERE content LIKE '%mongo%';" \
| sqlite3 ~/.meteor/package-metadata/v2.0.1/packages.data.db | grep -v errors :) I jotted down some thoughts in https://hackpad.com/Apollo-aware-NPM-packages-8XClPMNuBam; maybe others can help add to it. |
Very nice! Do you think there is something else we could use instead of Hackpad, like maybe the github wiki or a markdown file in this repo? I'd rather not have too many different places where files are scattered. |
Sure. I think the wiki is better, easier for people to edit, but I'm easy. I tried to go there now but it seems to just redirect to the main repo's URL. I think someone with commit access has to create the first page first. Maybe. |
@gadicc I made the wiki public and editable by anyone. Let's see how it goes! |
Excellent! Let's keep this open for discussion. You can also join our slack team! http://slack.apollostack.com/ |
I was thinking about cms integrations and this looks to be something that could be huge. For example there is a discussion going on in Drupal community about going headless progressively or even fully. I could totally imagine a package like apollo-drupal or apollo-wordpress. |
Wow that would be awesome! Having a GraphQL API on top of Drupal would make it super easy to build frontend apps on it. |
Those guys from Wordpress are becoming Node enthusiasts already, only a matter of time before they release a Wordpress server that's based on Node instead of PHP, making a GraphQL API even more attractive. |
WordPress + GraphQL: https://github.com/ramsaylanier/WordPressExpress |
OMG using Apollo Client with a wordpress backend would be so cool. |
Note: I haven't done much about this topic yet, but hope to give integration packages a lot more thought in the next week! |
Love it! |
@stubailo I'm working on using Apollo with Wordpress in the next week or two to replace GraphQL + Relay in WordExpress! Thanks for the words of encouragement! |
Amazing -- Excited to help answer any questions, and get bugs fixed if you run into anything! If you're interested in SSR/Hydration, we have a project that @jbaxleyiii is starting up here: https://github.com/apollostack/react-router-apollo/issues/1 Does that sound like something you would need? |
@ramsaylanier let me know how I can help! |
Yes absolutely @stubailo @jbaxleyiii - one of my biggest hurdles is getting SSR to work with Relay/GraphQL. This is pretty much a non-starter if I can't get it to work as SEO is huge requirement when working with WordPress (or any CMS really) |
@ramsaylanier same for us! 👍 |
so far I've just been able to replace the graphqlHTTP with apolloServer and started implementing and routes and stuff. |
So I've been able to completely replace Relay with Apollo in WordExpress and it works perfectly. I'm not use resolvers or connectors as per the Apollo documentation - I'm using GraphQL types manually but end result is the same. I've made an npm module that easily connects to a WordPress database and provides a basic GraphQL schema. Check it out. |
That's awesome! Is it possible to use Wordpress for just part of the schema and add extra data from a separate database? I am really excited about the possibility of having NPM packages that ship part of a schema, and can be used together to build a schema over multiple backends. |
It is something I have thought about but have not tried. I think it would be pretty easy this way - you just have to modify the resolve functions when you are defining your GraphQL schema. Yeah! I definitely wanted my basic WordPress schema to be extendable and I think I have achieved that goal - at least on a basic level. |
@ramsaylanier any place I can check out how you've used Apollo (the repo you linked seems to be from before)? Definitely want to learn how it went and what could be improved! |
The ApolloPress repo is where I've been playing around with it - I havent updated the readme or anything. You might find this commit to be interesting and it shows pretty much how I replaced Relay with Connect. |
@ramsaylanier wow! How did you delete so much code? |
Eh, parts of that commit are misleading - I had some duplicate schema stuff in the /data folder that I moved to a /schema folder and forgot to remove earlier. I think overall the amount of code is about the same between Apollo and Relay. |
Is anyone else working on authentication via graphQL? Is this a good place to mention it? I'm working on an I have a lot of travel over the next few days but hope to have an early release out by next weekend. By then I'll have a few proposals to improve the API for packages, relating back to this thread. And setup instructions for Saturn :) (cc @tmeasday) |
@gadicc I've implemented the same thing, (passport + JWT) though haven't packaged it yet. It's really pretty simple. I'd love you see your implementation. |
I wrote JWT auth without using passport. I'm interested to see what you On 30 June 2016 at 17:07, Peter Siegesmund notifications@github.com wrote:
|
hey @siegesmund & @ciwolsey. So firstly, sorry for my super late reply... I had a lot of unexpected commitments come up, but I've been consistently working on this as time has allowed. I was about to announce an early release on the forums, but was just made aware of the |
Hey guys, absolutely epic work here! 👏 Can't believe how quickly everything has been put together, especially all the various integrations, etc.
One of the most awesome things about Meteor for me has always been how packages could rely on the full stack. But for the majority of cases, this really just amounted to having database access on the client and server (and routing, but we'll save that for another day).
I think it would be great to have some guidelines for package authors, even if they're pretty simple and obvious. The idea is that application developers will have a consistent experience in adding apollo-aware packages to their app. i.e.
And then for package authors, maybe something like:
with guidelines / recommendations, i.e. Apollo packages should:
constructor(options)
that takes anapolloClient
orapolloServer
Like I said, this is may be quite simple and obvious, but I think a consistent and easy application developer experience will do wonders for quick and happy adoption.
The directory layout about could also be a recommendation for application developers, but they can do whatever makes sense for them, the main thing is that instantiating apollo packages is a consistent and natural experience.
The text was updated successfully, but these errors were encountered: