
Security News
/Company News
Securing the Financial Frontier: How Capital One Uses Socket for Open Source Security
Capital One is partnering with Socket to proactively secure its open source supply chain.
@galaxy-stack/orbit-graphql
Advanced tools
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
The npm package @galaxy-stack/orbit-graphql receives a total of 547 weekly downloads. As such, @galaxy-stack/orbit-graphql popularity was classified as not popular.
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.

Security News
/Company News
Capital One is partnering with Socket to proactively secure its open source supply chain.

Security News
Socket CTO Ahmad Nassri discusses how to keep AI agents from bypassing package blocks, limit credential access, and monitor their actions.

Security News
GPT-6 Astra tried to plant malicious code in simulated open source projects using fake GitHub accounts and deceptive PRs during an assigned CTF challenge.