
Security News
upm Launches as a Fast, Tiny Package Manager Written in TypeScript
upm uses Node.js to deliver fast npm installs in about 250 KB, with a JavaScript API and security defaults.
@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
upm uses Node.js to deliver fast npm installs in about 250 KB, with a JavaScript API and security defaults.

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.