question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow passing in path to .graphql file for typeDefs

See original GitHub issue

In most scenarios, the type definitions for the server live in their own .graphql file (best practices from the boilerplates). It would be convenient to pass in the file path, instead of having to load the file first, and pass in the contents to typeDefs.

This could be implemented either as a separate parameter (typeDefsPath?) or by reusing typeDefs.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kbrandwijkcommented, Dec 28, 2017

typeDefs.endsWith('.graphql')?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow passing in path to .graphql file for typeDefs #49 - GitHub
Regarding calling it typeDefs : Is there a reliable and inexpensive way to check whether the passed in string is a path or...
Read more >
Modularizing your GraphQL schema code
Expanding on our previous example, here's our schema.js file with some resolvers added into the picture: // schema.js import { typeDef as Author...
Read more >
How do I use schema.graphql file as typeDefs? - Stack Overflow
js and I am currently using graphql-yoga as a GraphQLServer. Now, I want to seperate Type Definitions and Resolvers so I have used...
Read more >
Passing Arguments - GraphQL
Just like a REST API, it's common to pass arguments to an endpoint in a GraphQL API. By defining the arguments in the...
Read more >
GraphQL + TypeScript - A progressive Node.js framework
To enable watch mode for the script (to automatically generate typings whenever any .graphql file changes), pass the watch option to the generate()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found