Socket
Socket
Sign inDemoInstall

gql.tada

Package Overview
Dependencies
Maintainers
1
Versions
229
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gql.tada - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1-canary-7986c5421362da3ff161beb2a2ed90c51fa04b27

86

dist/gql-tada.d.ts

@@ -5,6 +5,6 @@ import {

DocumentNode,
FragmentSpreadNode,
InlineFragmentNode,
FieldNode,
NameNode,
FragmentSpreadNode,
InlineFragmentNode,
TypeNode,

@@ -1021,6 +1021,6 @@ } from '@0no-co/graphql.web';

? Directive['name']['value'] extends 'include' | 'skip' | 'defer'
? false
? true
: isOptionalRec<Rest>
: isOptionalRec<Rest>
: true;
: false;
type getFieldAlias<Node extends FieldNode> = Node['alias'] extends undefined

@@ -1090,3 +1090,3 @@ ? Node['name']['value']

}
? Type['possibleTypes']
? Type['name'] | Type['possibleTypes']
: Type['name'];

@@ -1100,41 +1100,5 @@ type getSelection<

},
> = obj<
getFieldsSelectionRec<Selections, Type, Introspection, Fragments> &
getFragmentsSelection<Selections, Type, Introspection, Fragments>
>;
type getFieldsSelectionRec<
> = obj<getPossibleTypesSelection<Selections, Type, Introspection, Fragments>>;
type _getPossibleTypeSelectionRec<
Selections extends readonly unknown[],
Type extends ObjectLikeType,
Introspection extends IntrospectionLikeType,
Fragments extends {
[name: string]: any;
},
> = Selections extends readonly [infer Selection, ...infer Rest]
? (Selection extends FieldNode
? isOptionalRec<Selection['directives']> extends true
? {
[Prop in getFieldAlias<Selection>]: Selection['name']['value'] extends '__typename'
? getTypenameOfType<Type>
: unwrapType$1<
Type['fields'][Selection['name']['value']]['type'],
Selection['selectionSet'],
Introspection,
Fragments
>;
}
: {
[Prop in getFieldAlias<Selection>]?: Selection['name']['value'] extends '__typename'
? getTypenameOfType<Type>
: unwrapType$1<
Type['fields'][Selection['name']['value']]['type'],
Selection['selectionSet'],
Introspection,
Fragments
>;
}
: {}) &
getFieldsSelectionRec<Rest, Type, Introspection, Fragments>
: {};
type _getFragmentsSelectionRec<
Selections extends readonly unknown[],
PossibleType extends string,

@@ -1150,5 +1114,5 @@ Type extends ObjectLikeType,

ObjectLikeType
? PossibleType extends Subtype['name'] | getTypenameOfType<Subtype>
? PossibleType extends getTypenameOfType<Subtype>
?
| (isOptionalRec<Node['directives']> extends true ? never : {})
| (isOptionalRec<Node['directives']> extends true ? {} : never)
| getFragmentSelection<Node, Subtype, Introspection, Fragments>

@@ -1159,6 +1123,28 @@ : {}

: {}
: {}) &
_getFragmentsSelectionRec<Rest, PossibleType, Type, Introspection, Fragments>
: Node extends FieldNode
? isOptionalRec<Node['directives']> extends true
? {
[Prop in getFieldAlias<Node>]?: Node['name']['value'] extends '__typename'
? PossibleType
: unwrapType$1<
Type['fields'][Node['name']['value']]['type'],
Node['selectionSet'],
Introspection,
Fragments
>;
}
: {
[Prop in getFieldAlias<Node>]: Node['name']['value'] extends '__typename'
? PossibleType
: unwrapType$1<
Type['fields'][Node['name']['value']]['type'],
Node['selectionSet'],
Introspection,
Fragments
>;
}
: {}) &
_getPossibleTypeSelectionRec<Rest, PossibleType, Type, Introspection, Fragments>
: {};
type getFragmentsSelection<
type getPossibleTypesSelection<
Selections extends readonly unknown[],

@@ -1175,3 +1161,3 @@ Type extends ObjectLikeType,

? objValues<{
[PossibleType in Type['possibleTypes']]: _getFragmentsSelectionRec<
[PossibleType in Type['possibleTypes']]: _getPossibleTypeSelectionRec<
Selections,

@@ -1188,3 +1174,3 @@ PossibleType,

}
? _getFragmentsSelectionRec<Selections, Type['name'], Type, Introspection, Fragments>
? _getPossibleTypeSelectionRec<Selections, Type['name'], Type, Introspection, Fragments>
: {};

@@ -1191,0 +1177,0 @@ type getOperationSelectionType<

{
"name": "gql.tada",
"description": "The spec-compliant & magical GraphQL query language engine in the TypeScript type system",
"version": "1.0.0",
"version": "1.0.1-canary-7986c5421362da3ff161beb2a2ed90c51fa04b27",
"author": "0no.co <hi@0no.co>",

@@ -6,0 +6,0 @@ "source": "./src/index.ts",

@@ -47,33 +47,4 @@ <div align="center">

```ts
import { graphql } from 'gql.tada';
import { myIntrospectionQuery } from './fixtures/introspection';
<img width="100%" alt="Code Editor showing GraphQL queries being edited with gql.tada and GraphLSP" src="https://github.com/0no-co/gql.tada/blob/277ce424a747522ef2ca0d398b113f4f285eb595/website/public/demo-code.png?raw=true" />
// We can declare our introspected schema once globally
declare module 'gql.tada' {
interface setupSchema {
introspection: typeof myIntrospectionQuery;
}
}
// Creates fragment documents
const fragment = graphql(`
fragment HelloWorld extends Query {
hello
world
}
`);
// Creates queries, optionally accepting a list of fragments for fragment spreads
const query = graphql(
`
{
hello
...HelloWorld
}
`,
[fragment]
);
```
## 📦 [Releases](https://github.com/0no-co/gql.tada/releases)

@@ -80,0 +51,0 @@

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