Skip to content

Commit

Permalink
Daisy Completions for branch: main (#111)
Browse files Browse the repository at this point in the history
Co-authored-by: daisy[bot] <[email protected]>
  • Loading branch information
github-actions[bot] and daisy[bot] authored Oct 20, 2023
1 parent bdfbd7f commit 06388f5
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion daisy/markdown/.env.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NEXT_PUBLIC_CONTENTFUL_SPACE_ID=
CONTENTFUL_MAX_BATCH_SIZE=400

# GRAPHQL
GRAPHQL_SERVER_URL=http://localhost:3000/api/graphql
GRAPHQL_SERVER_URL=http://localhost:5000/graphql
GRAPHQL_SERVER_TIMEOUT=60000

# SENTRY
Expand Down
1 change: 0 additions & 1 deletion daisy/markdown/README.md.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ In order to use visual testing to verify that the page has not changed you need
| CONTENTFUL_PREVIEW_TOKEN | Preview token from Contentful (ask your admin for this value) |
| CONTENTFUL_SPACE_ID | The ID of the Contentful space. This value depends on the client’s contentful set up, you can grab this from the Contentful URL (e.g. https://app.contentful.com/spaces/{CONTENTFUL_SPACE_ID}/settings/space) |
| CONTENTFUL_USE_PREVIEW | This can be true or false. If you set it to true, it means that the framework is going to pull draft and published content. If you set it to false, the framework is only going to pull published content (aka production). |
| GRAPHQL_SERVER_URL | This is the URL that the GraphQL client is going to use to connect to the server. For your local environment it should be http://localhost:3000/api/graphql, for Netlify it should be /.netlify/functions/graphql. |
| LOG_LEVEL | Log level for the different processes, usually debug for the local environment. |
| NEXT_PUBLIC_CONTENTFUL_ENV | Same as CONTENTFUL_ENV, this is the public environment variable used for Sidekick |
| NEXT_PUBLIC_CONTENTFUL_SPACE_ID | Same as CONTENTFUL_SPACE_ID, this is the public environment variable used for Sidekick |
Expand Down
2 changes: 1 addition & 1 deletion daisy/markdown/apollo.config.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
service: {
name: process.env.APOLLO_GRAPH_REF || 'Last-Rev-Next-Starter',
localSchemaFile: path.resolve(__dirname, './packages/graphql-sdk/schema.graphql'),
url: process.env.GRAPHQL_SERVER_URL || 'http://localhost:5000/graphql'
url: 'http://localhost:5000/graphql'
},
includes: ['./packages/components/**/*.graphql', './packages/graphql-sdk/src/**/*.graphql'],
excludes: ['**/generated/**']
Expand Down
7 changes: 2 additions & 5 deletions daisy/markdown/packages/graphql-runner/wait-on-config.js.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
require('dotenv').config();
const URL = `${(process.env.GRAPHQL_SERVER || 'http://localhost:5000/graphql').replace(
/^http:/,
'http-get:'
)}?query={__schema{types{name}}}`;
require('envkey');
const URL = `${'http://localhost:5000/graphql'.replace(/^http:/, 'http-get:')}?query={__schema{types{name}}}`;

const resource = `tcp:${URL?.split(':')?.pop()?.split('/')?.shift()}`;
const timeout = process.env.GRAPHQL_SERVER_TIMEOUT ? parseInt(process.env.GRAPHQL_SERVER_TIMEOUT, 10) : 0;
Expand Down
2 changes: 1 addition & 1 deletion daisy/markdown/packages/graphql-sdk/README.md.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Always save the changes to your schema.graphql file!

# Expected Environment Variables

- GRAPHQL_SERVER_URL (optional) - URL of the GraphQL server. If not provided, defaults to `http://localhost:3000/api/graphql`
URL of the GraphQL server. If not provided, defaults to `http://localhost:3000/api/graphql`

# About

Expand Down
2 changes: 1 addition & 1 deletion daisy/markdown/packages/graphql-sdk/codegen.schema.yml.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
generates:
./schema.graphql:
schema: ${GRAPHQL_SERVER_URL:"http://localhost:5000/graphql"}
schema: http://localhost:5000/graphql
plugins:
- schema-ast
7 changes: 2 additions & 5 deletions daisy/markdown/packages/graphql-sdk/wait-on-config.js.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
require('dotenv').config();
const URL = `${(process.env.GRAPHQL_SERVER || 'http://localhost:5000/graphql').replace(
/^http:/,
'http-get:'
)}?query={__schema{types{name}}}`;
require('envkey');
const URL = `${'http://localhost:5000/graphql'.replace(/^http:/, 'http-get:')}?query={__schema{types{name}}}`;

const resource = `tcp:${URL?.split(':')?.pop()?.split('/')?.shift()}`;
const timeout = process.env.GRAPHQL_SERVER_TIMEOUT ? parseInt(process.env.GRAPHQL_SERVER_TIMEOUT, 10) : 0;
Expand Down
1 change: 1 addition & 0 deletions daisy/markdown/packages/utils/src/graphqlEndpoint.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ const deployUrl = process.env.DEPLOY_URL || process.env.VERCEL_URL;

const graphqlEndpoint =
process.env.STAGE === 'build' || !deployUrl ? 'http://localhost:5000/graphql' : `${deployUrl}/api/graphql`;
console.log({ STAGE: process.env.STAGE, deployUrl, graphqlEndpoint });

export default graphqlEndpoint;

0 comments on commit 06388f5

Please sign in to comment.