Skip to content

Commit

Permalink
Merge branch 'master' into chang/fix/restore-engine-false-no-env
Browse files Browse the repository at this point in the history
  • Loading branch information
abernix committed Jun 19, 2019
2 parents ece7163 + c6e7e5b commit c046802
Show file tree
Hide file tree
Showing 18 changed files with 485 additions and 296 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
### vNext

- `apollo-gateway`: Pass `context` through to the `graphql` command in `LocalGraphQLDatasource` `process` method [PR #2821](https://github.com/apollographql/apollo-server/pull/2821)
- `apollo-gateway`: Fix gateway not sending needed variables for subqueries not at the root level [PR #2867](https://github.com/apollographql/apollo-server/pull/2867)
- `apollo-federation`: Allow matching enums/scalars in separate services and validate that enums have matching values [PR #2829](https://github.com/apollographql/apollo-server/pull/2829).
- `apollo-federation`: Strip `@external` fields from interface extensions [PR #2848](https://github.com/apollographql/apollo-server/pull/2848)
- `apollo-federation`: Add support for list type keys in federation. [PR #2841](https://github.com/apollographql/apollo-server/pull/2841)
- `apollo-federation`: Deduplicate variable definitions for subqueries [PR #2840](https://github.com/apollographql/apollo-server/pull/2840)
- `apollo-federation`: Preserve docstrings in SDL of federated services. [PR #2830](https://github.com/apollographql/apollo-server/pull/2830)
- `apollo-engine-reporting`: Set `forbiddenOperation` and `registeredOperation` later in the request lifecycle [PR #2828](https://github.com/apollographql/apollo-server/pull/2828)
- `apollo-server-core`: fix setting `engine: false` should ignore `ENGINE_API_KEY` in environment variable [PR #2850](https://github.com/apollographql/apollo-server/pull/2850)
- `apollo-server-core`: Bug fix: Setting `engine: false` should ignore `ENGINE_API_KEY` in environment variable [PR #2850](https://github.com/apollographql/apollo-server/pull/2850)
- `apollo-server-core`: Add queryHash to GraphQLExecutor for federation [PR #2822](https://github.com/apollographql/apollo-server/pull/2822)

### v2.6.2

Expand Down
179 changes: 67 additions & 112 deletions docs/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"serve": "gatsby serve"
},
"dependencies": {
"gatsby": "2.8.6",
"gatsby": "2.9.4",
"gatsby-theme-apollo-docs": "1.0.11"
}
}
4 changes: 2 additions & 2 deletions docs/source/deployment/azure-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ Note: When GraphQL Playground starts, It won't have the correct URL containing t
![Apollo server running on azure with error](../images/deployment/azure-functions/apollo-server-on-azure.png)
We just need to put the full URL that includes the security `code` in the Playground url box. The background polling should refresh the screen momentarily. Click the **Schema** button to see if the docs are loaded correctly as the image below.
We just need to put the full URL that includes the security `code` in the Playground url box. The background polling should refresh the screen momentarily. Click the **Schema** button to see if the docs are loaded correctly as shown in the image below.
![Apollo server running on azure with success](../images/deployment/azure-functions/apollo-server-on-azure-sucess.png)
### Cleaning Up
After complete this tutorial, you can delete all resources at your Azure platform by removing the **az group**. We can delete manually each resource using the following commands:
After completing this tutorial, you can delete all the resources you created during this example from your Azure account by removing the Azure Resource Group called **apollo-examples** with the **az group** commmand. We can manually delete each resource using the following commands:
```shell
az functionapp delete \
Expand Down
46 changes: 46 additions & 0 deletions docs/source/federation/core-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,49 @@ extend type Query {
```

There is no need to explictly define `Query` or `Mutation` base types anywhere; Apollo automatically handles this for you.

## Sharing Types

Sometimes, Enum or Scalar types are needed in multiple services. Rather than having a single service "own" those types, all services that use them are expected to share ownership of those types.

Defining the same Enum or Scalar across services is supported **as long as the definitions are all identical**.

For Enum types, all values must match across services. **Even if a service doesn't use all values in an Enum, they still must be defined in the schema**. Failure to include all enum values in all services that use the Enum will result in a validation error when building the federated schema.

For scalar values, it's important that services **share the same serialization and parsing logic**, since there is no way to validate that logic from the schema level by federation tooling.

In the following example, the Product and User services both use the same ProductCategory enum and Date scalar.

```graphql
# Product Service
scalar Date

type Product @key(fields: "sku"){
sku: ID!
category: ProductCategory
dateCreated: Date
}

enum ProductCategory {
FURNITURE
BOOK
DIGITAL_DOWNLOAD
}

# User Service
scalar Date

type User @key(fields: "id"){
id: ID!
dateCreated: Date
favoriteCategory: ProductCategory
}

enum ProductCategory {
FURNITURE
BOOK
DIGITAL_DOWNLOAD
}
```


4 changes: 3 additions & 1 deletion docs/source/federation/federation-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ directive @external on FIELD_DEFINITION
directive @requires(fields: _FieldSet!) on FIELD_DEFINITION
directive @provides(fields: _FieldSet!) on FIELD_DEFINITION
directive @key(fields: _FieldSet!) on OBJECT
directive @key(fields: _FieldSet!) on INTERFACE

# this is an optional directive discussed below
directive @extends on OBJECT
Expand Down Expand Up @@ -227,9 +228,10 @@ A new field must be added to the query root called `_entities`. This field must

```graphql
directive @key(fields: _FieldSet!) on OBJECT
directive @key(fields: _FieldSet!) on INTERFACE
```

The `@key` directive is used to indicate a combination of fields that can be used to uniquely identify and fetch an object.
The `@key` directive is used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface.

```graphql
type Product @key(fields: "upc") {
Expand Down
4 changes: 2 additions & 2 deletions docs/source/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ This is just the beginning. We have published a [roadmap](https://github.com/apo

### Automatic Persisted Queries

A persisted query is an ID or hash that can be sent to the server in place of the GraphQL query string. This smaller signature reduces bandwidth utilization and speeds up client loading times. Apollo Server enables persisted queries without additional server configuration, using an in-memory LRU cache to store the mapping between hash and query string. The persisted query cache can be configured as shown in the following code snippet. To enable persisted queries on the client, follow the [Performance Guide](https://www.apollographql.com/docs/guides/performance.html#Automatic-Persisted-Queries).
A persisted query is an ID or hash that can be sent to the server in place of the GraphQL query string. This smaller signature reduces bandwidth utilization and speeds up client loading times. Apollo Server enables persisted queries without additional server configuration, using an in-memory LRU cache to store the mapping between hash and query string. The persisted query cache can be configured as shown in the following code snippet. To enable persisted queries on the client, follow the [Performance Guide](https://www.apollographql.com/docs/apollo-server/features/apq/).

```js{7-12}
const { ApolloServer } = require('apollo-server');
Expand All @@ -70,7 +70,7 @@ server.listen().then(({ url }) => {
});
```

For more information on automatic persisted queries, check the [APQ section of the performance guide](https://www.apollographql.com/docs/guides/performance.html#automatic-persisted-queries).
For more information on automatic persisted queries, check the [APQ section of the performance guide](https://www.apollographql.com/docs/apollo-server/features/apq/).

### CDN integration

Expand Down
Loading

0 comments on commit c046802

Please sign in to comment.