
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
@galaxy-stack/orbit-graphql
Advanced tools
Part of the Orbit framework — a NestJS-style backend framework for Bun.
bun add @galaxy-stack/orbit-graphql
Module GraphQL cho Orbit với code-first approach, DataLoader support và WebSocket subscriptions.
import {
ObjectType, Field, Query, Mutation,
Resolver, Args, Int
} from '@galaxy-stack/orbit-graphql';
@ObjectType()
class User {
@Field(() => Int)
id!: number;
@Field()
name!: string;
@Field({ nullable: true })
email?: string;
}
@Resolver(() => User)
class UserResolver {
@Query(() => User)
async user(@Args('id', Int) id: number) {
return await this.userService.findById(id);
}
@Query(() => [User])
async users() {
return await this.userService.findAll();
}
@Mutation(() => User)
async createUser(@Args('input') input: CreateUserInput) {
return await this.userService.create(input);
}
}
@InputType()
class CreateUserInput {
@Field()
name!: string;
@Field({ nullable: true })
email?: string;
}
import { createDataLoader, ResolveField, Parent } from '@galaxy-stack/orbit-graphql';
@Resolver(() => Post)
class PostResolver {
private authorLoader = createDataLoader(
async (ids: number[]) => this.userService.findByIds(ids)
);
@ResolveField(() => User)
async author(@Parent() post: Post) {
return this.authorLoader.load(post.authorId);
}
}
import { Subscription, PubSub } from '@galaxy-stack/orbit-graphql';
@Resolver()
class NotificationResolver {
@Subscription(() => Notification)
notificationAdded() {
return pubSub.asyncIterator('NOTIFICATION_ADDED');
}
}
// Publish event
pubSub.publish('NOTIFICATION_ADDED', { notificationAdded: notification });
import { GraphQLModule } from '@galaxy-stack/orbit-graphql';
@Module({
imports: [
GraphQLModule.forRoot({
autoSchemaFile: true,
playground: true,
subscriptions: {
'graphql-ws': true,
},
}),
],
providers: [UserResolver, PostResolver],
})
class AppModule {}
@ObjectType()
class Product {
@Field(() => Int)
id!: number;
@Field(() => Float)
price!: number;
@Field(() => [String])
tags!: string[];
@Field(() => Int, { defaultValue: 0 })
stock!: number;
@Field({ deprecationReason: 'Use newField instead' })
oldField!: string;
}
import { registerEnumType } from '@galaxy-stack/orbit-graphql';
enum UserRole {
ADMIN = 'ADMIN',
USER = 'USER',
}
registerEnumType(UserRole, { name: 'UserRole' });
@ObjectType()
class User {
@Field(() => UserRole)
role!: UserRole;
}
@UseGuards(GqlAuthGuard)
@Resolver()
class ProtectedResolver {
@Query(() => String)
@UseInterceptors(LoggingInterceptor)
protected() {
return 'Protected data';
}
}
FAQs
GraphQL module for Orbit framework
We found that @galaxy-stack/orbit-graphql demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.