Skip to content
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

Pure Apollo integration based on master #1664

Closed
wants to merge 22 commits into from

Conversation

piglovesyou
Copy link
Collaborator

@piglovesyou piglovesyou commented Sep 4, 2018

Pure Apollo integration based on master.

Features

  • TypeScript implementation that Apollo primarily supports
  • apollo-client with full server-side rendering - No fetch()
  • Client-side state management with apollo-client@2.5 with networkStatus example
  • apollo-server serves GraphQL API
  • Codegen Flow types - Flow type checking follows GraphQL Schema
  • More Flow Types - More confident use of component properties
  • GraphQL Scalar type - Timestamp for an example

Branches

@piglovesyou piglovesyou force-pushed the feature/apollo-pure branch 6 times, most recently from 24e02f8 to 5ef8174 Compare September 4, 2018 09:33
- [x] `apollo-client` with full server-side rendering
- [x] `apollo-link-state` - Client-side state management with `networkStatus` example
- [x] `apollo-server`

Without:

* Flux (Redux) store - replaced by `apollo-link-state`
* Fetch function - No need when you have an `apolloClient`
@langpavel
Copy link
Collaborator

Hi! Great work, I will review it in my rare free time 🙂
Will be great if you prepare new PR which I can merge to master with updated README
— added link to feature/apollo-pure branch which I can create from this PR.

Please remind me in few days if I forget to do it 😉

@piglovesyou
Copy link
Collaborator Author

@langpavel Thank you for your support. I did on #1665 .

@langpavel
Copy link
Collaborator

Your work is now pushed in feature/apollo-pure branch

@piglovesyou
Copy link
Collaborator Author

@langpavel Wow, pleasure, thanks.

Then shall I delete this PR? Further commits and discussion seem to go in #1666.

@langpavel
Copy link
Collaborator

Don't delete this PR, you can push fresh commits here.
I believe that you can open new PRs against feature/apollo-pure branch from commits on top of this branch.

@piglovesyou
Copy link
Collaborator Author

All right. I'll push another to it when I feel like it.

@piglovesyou
Copy link
Collaborator Author

@langpavel I have a question. When I'd like to update kreasoft:feature/apollo-pure, I need to create a PR on it every time, is that correct? I'm thinking publishing another feature like apollo codegen.

@piglovesyou
Copy link
Collaborator Author

piglovesyou commented Feb 18, 2019

Sorry I missed your previous comment, I'll create a PR pointing to kreasoft:feature/apollo-pure.

* Upgrade all dependencies

1. ncu --upgradeAll
4. Leave "graphql" to be "^13.2.0" that apollo packages depend on
2. Apply patch of "npx babel-upgrade" output
3. Leave only necessary babel plugins
4. Pass "yarn fix" by disabling stricter rules

* Pass "req" through GraphQL resolver context

* Through rootValue it cannot be passed from browser GraphQL access
* rm unnecessary code

* Add "Timestamp" scalar type for convinience

* rm unnecessary files

* fix: Timestamp didn't work

* npm graphql requires to be update
vercel/next.js#5238 (comment)

* Feature: Codegen from GraphQL schema and use more Flow types (#2)

* install apllo

* add apollo.config.js

* apollo codegen succeeded

* fix: updateNetworkStatus signature

* rm @flow from files not ready

* add flow-typed files

* done: Using auto-generated types works

* flow-bin@0.89+ has regression. Use ^0.88.0.

* fix: invalid GraphQL primitive types

* Add codegen script

* done: import auto-generated file

* refac: move impl for apollo-link-state to graphql dir as same as server side resolvers

* codegen and ignore eslint these files

* refactor: "networkStatus"

* feat: codegen:standalone

* refac: "OnMemoryState" is what I meant

* Improve codegen (#3)

* delete existing auto-generated types

* change script name

* ignore __generated__ folder

* wip: disallow absolute path resolving under `src` dir

* It causes disregard .js type checking under src

* fix all flow error

* modify: prevent `withStyles` drops component type

* Modify targe Node versions

* Fix build failure: Codegen before lint

* Add Node v10 LTS for build target
* small README.md grammar change (kriasoft#1675)

* Upgrade all dependencies including Babel 7 (kriasoft#1673)

* Upgrade all dependencies including Babel 7

1. ncu --upgradeAll
4. Leave "graphql" to be "^13.2.0" that apollo packages depend on
2. Apply patch of "npx babel-upgrade" output
3. Leave only necessary babel plugins
4. Pass "yarn fix" by disabling stricter rules

fixes kriasoft#1654 kriasoft#1626 kriasoft#1607

* Also ignore babel config file from webpack.config.js

* Resolve conflict and follow upstream/master

* small README.md grammar change (kriasoft#1675)

* Upgrade all dependencies including Babel 7 (kriasoft#1673)

* Upgrade all dependencies including Babel 7

* update apollo packages

* Use new local state management of Apollo Client 2.5

* Client Schema
* Simplify cache and cache defaults
* User in local state instead of context

* bye apollo-link-state

* mod: better suppressing flow error for .graphql import

* fix: jest error by updating jest

* Upgrade all dependencies

fix 2 breaking changes:
* css-loader no longer accepts 'minimize' option
* isomorphic-style-loader uses new React Context now

* refac: Use functional component for components

* fix: resolve apollo and graphql versions problem

ref. apollographql/apollo-tooling#630 (comment)
@piglovesyou
Copy link
Collaborator Author

I think I can close this PR now. I'll keep maintaining feature/apollo-pure on #1666.

@piglovesyou piglovesyou deleted the feature/apollo-pure branch June 21, 2019 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants