New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nothing-but/graphstate

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nothing-but/graphstate

A reactive GraphQL client generator.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

graphstate

A reactive GraphQL client generator.

Work in progress.

Example usage:

import * as graphstate from "graphstate/sdk.js"


const _test_schema = `
schema {
	query: Query
}

type Query {
	foo: [String!]!
	bar(a: Int, b: Float): String
	person(id: ID!): Person
}

type Person {
	id: ID!
	name: String!
	age: Int!
}`

async function main() {
	const out = await graphstate.wasm_generate_queries(_test_schema)
	if (out instanceof Error) {
		console.error(out)
		return
	}
	console.log(out)
}


main()

Initial values for types:

# Type            | Initial value
String            # null
String!           # ""
Int!              # 0
Float!            # 0
Boolean!          # false
ID!               # "" ?????
[String!]!        # []

type Link {       # {
  title: String!  #   title: "",
  url:   String!  #   url:   "",
}                 # }

enum LinkState {  # "None" (always the first member)
  None
  Bookmark
  InProgress
  Completed
}

union LinkUnion = LinkState | Link

LinkUnion         # null
LinkUnion!        # "None" (LinkState is the first member of the union)

FAQs

Package last updated on 31 Mar 2024

Did you know?

Socket

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.

Install

Related posts

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