Giter Site home page Giter Site logo

Comments (5)

bwlng avatar bwlng commented on June 26, 2024 2

Thanks for the workaround @Simply007. I can confirm that precomputing the data I'm filtering on as outlined in the schema-definition-changes repo is a good workaround for the properties that can't be filtered using KontentItem interface.

This doesn't affect the query performance described in #107, but as stated in that issue, the Gatsby team is aware and thinks it may be a regression on their end.

from gatsby-packages.

makma avatar makma commented on June 26, 2024 1

Hi @bwlng thank you for letting us know. I'm not sure about usedByContentItems (@Simply007 should know better), however, in my opinion missing other languages property is a bug. We will let you know!

from gatsby-packages.

Simply007 avatar Simply007 commented on June 26, 2024

Hello @bwlng,

thanks for submitting this. This is caused by the filter is using KontentItem interface that does not have most of the elements defined, because they are defined in inherited types.

Unfortunately, I haven't found any GraphQL possibilities to type this filter using inline fragment, nor the gatsby documentation according to the input filter and their potential inferring is not up to date.

On the other hand, I have tried a more clean way how to precompute some data to fields in OnCreateNode lifecycle method.

The solution is in the https://github.com/Simply007/schema-definition-changes repository

You might want to use any other lifecycle method (https://www.gatsbyjs.org/docs/node-apis/#gatsby-node-apis) by the specific use case. Or even setFieldsOnGraphQLNodeType if it suits you.

In my opinion, this might be also beneficial according to the performance of running queries described in #107, but it is just a guess, the performance peaks must be identified first - but worth a try!

from gatsby-packages.

Simply007 avatar Simply007 commented on June 26, 2024

According to the vision - we would like to extract the functionality of the "computed" properties from the source plugin and describe how to implement them right in the application or provide the transformers plugin if the property would be heavily used.

See #108

from gatsby-packages.

Simply007 avatar Simply007 commented on June 26, 2024

Great to hear @bwlng!

I am closing the issue for now.

If we missed anything on this issue or if you want to keep it open, feel free to do so.

from gatsby-packages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.