-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: prepare graphql service to be deployed (#40)
On this PR; - Add env configurations - Disable docker env for now - Point graphql API to fuel-client beta-4 live env
- Loading branch information
1 parent
985fa0f
commit 2dd8188
Showing
12 changed files
with
284 additions
and
239 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ node_modules | |
pnpm-lock.yaml | ||
storybook-static | ||
.next | ||
graphql.schema.json |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
FUEL_PROVIDER_URL=http://beta-4.fuel.network/graphql |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import dotenv from 'dotenv'; | ||
dotenv.config(); | ||
|
||
import app from './'; | ||
|
||
// Start the server: | ||
app.listen(4444, () => | ||
console.log('🚀 Explorer api running at http://localhost:4444/graphql'), | ||
); |
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,2 +1,3 @@ | ||
export * from './graphqlFetch'; | ||
export * from './getFieldsValues'; | ||
export * from './requireEnv'; |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export function requireEnv< | ||
A extends string[], | ||
B extends { [key in A[number]]: string }, | ||
>(keys: string[]): B { | ||
return keys.reduce((ret, key) => { | ||
if (!process.env[key]) { | ||
throw new Error(`Environment variable ${key} is required`); | ||
} | ||
ret[key] = process.env[key]!; | ||
return ret; | ||
}, {} as B); | ||
} |
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,6 +1,7 @@ | ||
import { defineConfig } from 'tsup'; | ||
|
||
export default defineConfig(() => ({ | ||
dts: true, | ||
entry: { index: 'src/generated/graphql.ts' }, | ||
minify: process.env.NODE_ENV === 'production' ? 'terser' : false, | ||
})); |
Oops, something went wrong.