
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
firestore-graphql-scalars
Advanced tools
A custom GraphQL scalar type for Firebase and Google Cloud Firestore.
npm install --save firestore-graphql-scalars
or
yarn add firestore-graphql-scalars
To use this scalar you'll need to add it in two places, your schema and your resolvers map.
In your schema:
scalar Timestamp
In your resolver map, first import them:
import { timestampResolver } from 'firestore-graphql-scalars';
Then make sure they're in the root resolver map like this:
const myResolverMap = {
Timestamp: timestampResolver,
Query: {
// more stuff here
},
Mutation: {
// more stuff here
},
};
Alternatively, use the default import and ES6's spread operator syntax:
import { resolvers } from 'firestore-graphql-scalars';
Then make sure they're in the root resolver map like this:
const myResolverMap = {
...resolvers,
Query: {
// more stuff here
},
Mutation: {
// more stuff here
},
};
That's it. Now you can use these scalar types in your schema definition like this:
type Person {
createdAt: Timestamp
...
}
These scalars can be used just like the base, built-in ones.
import { ApolloServer } from 'apollo-server';
import { makeExecutableSchema } from '@graphql-tools/schema';
import { typeDefs, resolvers } from 'firestore-graphql-scalars';
const server = new ApolloServer({
schema: makeExecutableSchema({
typeDefs: [
// use spread syntax to add scalar definitions to your schema
...typeDefs,
// DateTimeTypeDefinition,
// ...
// ... other type definitions ...
],
resolvers: {
// use spread syntax to add scalar resolvers to your resolver map
...resolvers,
// DateTimeResolver,
// ...
// ... remainder of resolver map ...
},
}),
});
server.listen().then(({ url }) => {
console.log(`🚀 Server ready at ${url}`);
});
Released under the MIT license.
Issues and Pull Requests are always welcome. ❤️
This repository is a fork of graphql-scalars. It's inspired by @lookfirst's issue and juicylevel/coffee-service. Big thanks to the contributors of these repositories! 🙏
FAQs
Scalar types for Google Firestore.
We found that firestore-graphql-scalars demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.