Crspy
Crspy
Explore posts from servers
RRailway
Created by Crspy on 10/13/2024 in #✋|help
Postman Docs
I'm trying to create a form on my website that deploys a github repository to railway with specified environment variables. I was wondering what the input fields for the githubRepoDeploy mutation were. I'm relatively new to graphql, and I couldn't find any explanation to the shape of the GitHubRepoDeployInput type. Any help is appreciated. Just trying to figure out what I can pass as input to this mutation.
mutation githubRepoDeploy($input: GitHubRepoDeployInput!) {
githubRepoDeploy(input: $input)
}
mutation githubRepoDeploy($input: GitHubRepoDeployInput!) {
githubRepoDeploy(input: $input)
}
In postman, the GraphQL Variables section looks like this:
{
"input": null
}
{
"input": null
}
if you can please ping me
17 replies
RRailway
Created by Crspy on 9/7/2024 in #✋|help
Railway API deployments
Is there a way to create deployments from github repositories via an API? I want to create an html form that deploys a project to Railway with the first form elements specifying the start command and the rest as environment variables. Is this possible? I saw a json file with a bunch of graphql specifications, but i dont know graphql and am looking for some help. Also is there a way to specify a root directory for a railway project?
5 replies
RRailway
Created by Crspy on 2/19/2024 in #✋|help
Connect one deployment to the volume on another deployment
Is there a way to link one of the following templates to a volume attached to a separate deployment on the same project? https://railway.app/template/guiCBv https://railway.app/template/Nan7Bs
31 replies
RRailway
Created by Crspy on 2/18/2024 in #✋|help
Sqlite DB
Is there a way I can add an sqlite database to a project in railway and have its data persist across deployments in my project?
57 replies
TTCTheo's Typesafe Cult
Created by Crspy on 2/4/2024 in #questions
Add parameters to tRPC Context
I would like to add the parameters of the type CreateNextContextOptions to my tRPC context in my t3-app project. I've looked through the documentation, but I cannot find a way to get the parameters to pass them to the createContext function in my createTRPCProxyClient definition in server.ts. In the docs, they just pass the typeof createTRPCContext as a generic in the initTRPC.context() function, which was done in a separate file when the project was generated. Does anyone know how I can get this to work?
const createContext = cache((opts: CreateNextContextOptions) => {
const heads = new Headers(headers());
heads.set("x-trpc-source", "rsc");

return createTRPCContext({
headers: heads,
}, opts);
});

export const api = createTRPCProxyClient<AppRouter>({
transformer,
links: [
loggerLink({
enabled: (op) =>
process.env.NODE_ENV === "development" ||
(op.direction === "down" && op.result instanceof Error),
}),
() =>
({ op }) =>
observable((observer) => {
createContext()
// ^^ TS2554: Expected 1 arguments, but got 0
.then((ctx) => {
return callProcedure({
procedures: appRouter._def.procedures,
path: op.path,
rawInput: op.input,
ctx,
type: op.type,
});
})
.then((data) => {
observer.next({ result: { data } });
observer.complete();
})
.catch((cause: TRPCErrorResponse) => {
observer.error(TRPCClientError.from(cause));
});
}),
],
});
const createContext = cache((opts: CreateNextContextOptions) => {
const heads = new Headers(headers());
heads.set("x-trpc-source", "rsc");

return createTRPCContext({
headers: heads,
}, opts);
});

export const api = createTRPCProxyClient<AppRouter>({
transformer,
links: [
loggerLink({
enabled: (op) =>
process.env.NODE_ENV === "development" ||
(op.direction === "down" && op.result instanceof Error),
}),
() =>
({ op }) =>
observable((observer) => {
createContext()
// ^^ TS2554: Expected 1 arguments, but got 0
.then((ctx) => {
return callProcedure({
procedures: appRouter._def.procedures,
path: op.path,
rawInput: op.input,
ctx,
type: op.type,
});
})
.then((data) => {
observer.next({ result: { data } });
observer.complete();
})
.catch((cause: TRPCErrorResponse) => {
observer.error(TRPCClientError.from(cause));
});
}),
],
});
2 replies