You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some discussions with @hutchgrant and exploring use cases around #21 , there is a case to be made that you could use GraphQL for not specifically tied to the graph specifically. For external content sure, that would need to go into the graph, but anything not content, like the config, might want to establish its own top level schema. But maybe there could be some overlap?
For example, for image galleries (as was the use case being discussed) your data source there would just be a set of images, either from a directory or cloud host.
Details
So basically this would require a convention / API for plugin-graphql to be able to scan for schemas in a repo and merge those into the overall schema. Similar to NextJS or Netlify, something like
// src/data/schema.js in a user's workspaceconstgql=require('graphql-tag');constgetGallery=async(root,query,context)=>{return[{name: 'Gallery 1',title: 'Gallery Title',images: [{path: '/assets/gallery1/image1.png'},{path: '/assets/gallery1/image2.png'}]}];};constgalleryTypeDefs=gql` type Image { path: String } type Gallery { name: String, title: String, images: [Image] } extend type Query { gallery: [Gallery] }`;constgalleryResolvers={Query: {gallery: getGallery}};module.exports={customTypeDefs: galleryTypeDefs,customResolvers: galleryResolvers};
You could then query it with your own .gql
query{gallery{name,title,images{
path
}}}
The text was updated successfully, but these errors were encountered:
Type of Change
Summary
In some discussions with @hutchgrant and exploring use cases around #21 , there is a case to be made that you could use GraphQL for not specifically tied to the graph specifically. For external content sure, that would need to go into the graph, but anything not content, like the config, might want to establish its own top level schema. But maybe there could be some overlap?
For example, for image galleries (as was the use case being discussed) your data source there would just be a set of images, either from a directory or cloud host.
Details
So basically this would require a convention / API for plugin-graphql to be able to scan for schemas in a repo and merge those into the overall schema. Similar to NextJS or Netlify, something like
You could then query it with your own .gql
The text was updated successfully, but these errors were encountered: