Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mercurius

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mercurius - npm Package Compare versions

Comparing version 8.4.0 to 8.4.1

4

lib/federation.js

@@ -95,2 +95,6 @@ /*

for (const definition of schemaDefinitions) {
if (definition.kind === 'SchemaDefinition') {
continue
}
const typeName = definition.name.value

@@ -97,0 +101,0 @@ const isTypeExtensionByDirective = hasExtensionDirective(definition)

2

package.json
{
"name": "mercurius",
"version": "8.4.0",
"version": "8.4.1",
"description": "Fastify GraphQL adapter with gateway and subscription support",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1028,1 +1028,63 @@ 'use strict'

})
test('basic federation support with \'schema\' in the schema', async (t) => {
const app = Fastify()
const schema = `
extend type Query {
me: User
}
type User @key(fields: "id") {
id: ID!
name: String
username: String
}
schema {
query: Query
}
`
const resolvers = {
Query: {
me: () => {
return {
id: '1',
name: 'John',
username: '@john'
}
}
},
User: {
__resolveReference: (object) => {
return {
id: object.id,
name: 'John',
username: '@john'
}
}
}
}
app.register(GQL, {
schema,
resolvers,
federationMetadata: true
})
await app.ready()
const query = '{ _service { sdl } }'
const res = await app.inject({
method: 'GET',
url: `/graphql?query=${query}`
})
t.same(JSON.parse(res.body), {
data: {
_service: {
sdl: schema
}
}
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc