Developing Hive locally requires you to have the following software installed locally:
nvm or fnm).vscode/extensions.json)nvm use to use the same version of node as mentionedpnpm i at the root to install all the dependencies and run the hookspnpm setup to create and apply migrations on the PostgreSQL databasepnpm run --filter @hive/storage setuppnpm generate to generate the typings from the graphql files (use pnpm graphql:generate if
you only need to run GraphQL Codegen)pnpm build to build all servicesStart Hive in the bottom bar of VSCodehttp://localhost:3000 by default) and Sign in with any of the identity providerhive.json within packages/libraries/cli which can be used to interact via the
hive cli with the registryWe have a script to feed your local instance of Hive.
Start Hive to run your local Hive instanceusage and usage-ingestor are running as well (with pnpm dev)TOKEN="MY_TOKEN_HERE" pnpm seedNote: You can set
STAGING=1in order to target staging env and seed a target there.
To send more operations and test heavy load on Hive instance, you can also set
OPERATIONS(amount of operations in each interval round, default is1) andINTERVAL(frequency of sending operations, default:1000ms). For example, usingINTERVAL=1000 OPERATIONS=1000will send 1000 requests per second.
packages/libraries/cli and run pnpm buildpackages/libraries/cli, run:
pnpm start schema:publish --token "YOUR_TOKEN_HERE" --registry "http://localhost:4000/graphql" examples/single.graphql$ loophole account login$ loophole http 3000 --hostname hive-<your-name> (@kamilkisiela I
use hive-kamil). It creates https://hive-<your-name>.loophole.site endpoint.APP_BASE_URL and AUTH0_BASE_URL in packages/web/app/.envpackages/web/app and open https://hive-<your-name>.loophole.site.We have a special Slack channel called
#hive-teststo not spam people :)
Setup URL in
GraphQL Hive Development
app and set it to https://hive-<your-name>.loophole.site/api/github/setup-callbackhttp://localhost:3000 by default) and register any email and password/_history endpoint -
http://localhost:6260/_history by default.
token should help you find the link.Note: If you are not working at The Guild, you can safely ignore this section.
Since we migrated from Auth0 to SuperTokens there is a compatibility layer for importing/migrating accounts from Auth0 to SuperTokens.
By default, you don’t need to set this up and can just use SuperTokens locally. However, if you need to test some stuff or fix the Auth0 -> SuperTokens migration flow you have to set up some stuff.
Regular Web Applicationhttp://localhost:3000/api/callbackhttp://localhost:3000/function (user, context, callback) {
const namespace = 'https://graphql-hive.com';
context.accessToken[namespace + '/metadata'] = user.user_metadata;
context.idToken[namespace + '/metadata'] = user.user_metadata;
context.accessToken[namespace + '/userinfo'] = {
user_id: user.user_id,
email: user.email,
username: user.username,
nickname: user.nickname
};
return callback(null, user, context);
}
.env secrets used by your local hive instance that are found when viewing your new
application on Auth0:
AUTH_LEGACY_AUTH0 (set this to 1 for enabling the migration.)AUTH_LEGACY_AUTH0_CLIENT_ID (e.g. rGSrExtM9sfilpF8kbMULkMNYI2SgXro)AUTH_LEGACY_AUTH0_CLIENT_SECRET (e.g.
gJjNQJsCaOC0nCKTgqWv2wvrh1XXXb-iqzVdn8pi2nSPq2TxxxJ9FIUYbNjheXxx)AUTH_LEGACY_AUTH0_ISSUER_BASE_URL(e.g. https://foo-bars.us.auth0.com)AUTH_LEGACY_AUTH0_AUDIENCE (e.g. https://foo-bars.us.auth0.com/api/v2/)