-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename a variety of things to no longer be called Apollo
- Loading branch information
Sashko Stubailo
committed
Oct 23, 2016
1 parent
2bbd0af
commit 4a5e6b3
Showing
16 changed files
with
51 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
# Apollo Server design goals | ||
# GraphQL Server design goals | ||
|
||
The goal of this project is to build a GraphQL server for Node.js that is simple, flexible, and performant. It is a Node.js GraphQL server built for production use. | ||
|
||
Apollo Server consists of three parts: | ||
GraphQL Server consists of three parts: | ||
|
||
1. Core | ||
2. Integrations | ||
3. Modules | ||
|
||
At the core of Apollo Server is a function called `runQuery`, which handles parsing, validating and executing queries. Its interface is generic in order to allow for integrations with different Node.js server frameworks. Extensions provide useful functionality that can be shared between different integrations. | ||
At the core of GraphQL Server is a function called `runQuery`, which handles parsing, validating and executing queries. Its interface is generic in order to allow for integrations with different Node.js server frameworks. Extensions provide useful functionality that can be shared between different integrations. | ||
|
||
|
||
### Core | ||
|
||
The main goals of Apollo Server are (in order of priority): | ||
The main goals of GraphQL Server are (in order of priority): | ||
|
||
1. Simplicity: Apollo Server’s core API is very straight forward. It’s one function that does one thing really well (parsing, validating and executing GraphQL queries), and doesn’t do anything else. | ||
2. Flexibility: The core of Apollo Server should be transport-agnostic (e.g. it doesn’t deal with HTTP or Websockets directly. This is will be handled in the wrappers for Express, Hapi, etc.) | ||
3. Performance: Apollo server should be be tunable to make it fast in production. One example of this is that it should be able to take pre-stored queries to skip parsing and validation. It should also allow easy integration of profiling tools like Apollo Tracer that help with debugging and optimizing server performance. | ||
1. Simplicity: GraphQL Server’s core API is very straight forward. It’s one function that does one thing really well (parsing, validating and executing GraphQL queries), and doesn’t do anything else. | ||
2. Flexibility: The core of GraphQL Server should be transport-agnostic (e.g. it doesn’t deal with HTTP or Websockets directly. This is will be handled in the wrappers for Express, Hapi, etc.) | ||
3. Performance: GraphQL server should be be tunable to make it fast in production. One example of this is that it should be able to take pre-stored queries to skip parsing and validation. It should also allow easy integration of profiling tools like Apollo Optics that help with debugging and optimizing server performance. | ||
|
||
### Integrations | ||
|
||
Apollo Server should come with a set of integrations for different Node.js server frameworks: | ||
GraphQL Server should come with a set of integrations for different Node.js server frameworks: | ||
|
||
- Express | ||
- Hapi | ||
- Connect | ||
- Koa | ||
- ... | ||
|
||
Framework integrations take care of parsing requests, submitting them to Apollo Server’s core runQuery function, and sending the response back to the client. These integrations should accept requests over HTTP, websockets or other means, then invoke `runQuery` as appropriate, and return the result. They should be written in such a way that makes it easy to add features, such as batched queries, subscriptions etc. | ||
Framework integrations take care of parsing requests, submitting them to GraphQL Server’s core runQuery function, and sending the response back to the client. These integrations should accept requests over HTTP, websockets or other means, then invoke `runQuery` as appropriate, and return the result. They should be written in such a way that makes it easy to add features, such as batched queries, subscriptions etc. | ||
|
||
Framework integrations should hide all transport-specific (eg. setting headers) and framework-specific things (eg. registering a route) from the core functions. | ||
|
||
### Modules | ||
Things that are not part of runQuery’s tasks, but are GraphQL specific (such as providing a bundle for the GraphiQL UI, generating a schema, storing prepared queries, etc.) should be implemented in another core module of Apollo Server that lives alongside runQuery, or be imported from graphql-tools or other related packages. | ||
Things that are not part of runQuery’s tasks, but are GraphQL specific (such as providing a bundle for the GraphiQL UI, generating a schema, storing prepared queries, etc.) should be implemented in another core module of GraphQL Server that lives alongside runQuery, or be imported from graphql-tools or other related packages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { apolloExpress, graphiqlExpress } from './expressApollo'; | ||
import { graphqlExpress, graphiqlExpress } from './expressApollo'; | ||
|
||
export const apolloConnect = apolloExpress; | ||
export const graphqlConnect = graphqlExpress; | ||
export const graphiqlConnect = graphiqlExpress; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
export { | ||
ExpressApolloOptionsFunction, | ||
ExpressHandler, | ||
apolloExpress, | ||
graphqlExpress, | ||
graphiqlExpress, | ||
} from './expressApollo'; | ||
|
||
export { | ||
apolloConnect, | ||
graphqlConnect, | ||
graphiqlConnect, | ||
} from './connectApollo'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { KoaApolloOptionsFunction, KoaHandler, apolloKoa, graphiqlKoa } from './koaApollo'; | ||
export { KoaGraphQLOptionsFunction, KoaHandler, graphqlKoa, graphiqlKoa } from './koaApollo'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nhanh = yêu cầu ( 'thể hiện' ) ;
var bodyParser = yêu cầu ( 'cơ thể phân tích cú pháp' ) ;
var { apolloExpress , graphiqlExpress } = yêu cầu ( 'apollo-máy chủ' ) ;
var { makeExecutableSchema } = yêu cầu ( 'graphql-công cụ' ) ;
var Typedefs = [ '
gõ truy vấn {
xin chào: String
}
lược đồ {
truy vấn: Truy vấn
} ` ] ;
var phân giải = {
Query : {
xin chào ( gốc ) {
trở lại 'thế giới' ;
}
}
} ;
var schema = makeExecutableSchema ( { Typedefs , phân giải } ) ;
var ứng dụng = nhanh ( ) ;
ứng dụng . sử dụng ( '/ graphql' , bodyParser . json ( ) , apolloExpress ( { schema } ) ) ;
ứng dụng . sử dụng ( '/ graphiql' , graphiqlExpress ( { endpointURL : '/ graphql' } ) ) ;
ứng dụng . nghe ( 4000 , ( ) = > giao diện điều khiển . log ( 'Bây giờ thì vào localhost: 4000 / graphiql' ) ) ;