Comments (11)
I am not really at ease with GraphQL yet but it seems that elemMatch will not do what you want. AFAIU gatsby internally uses sift https://github.com/crcn/sift.js/tree/master#elemmatch and the elemMatch it seems to be projecting all returning results.
since you are filtering thumbnails it find the ones that have the desired width and returns the whole array.
I am searching for a solution
from gatsby-source-instagram.
Yep i think all the functions project results. It seems it is not possible to filter out specific items like you need to. But you can do this in js easily.
from gatsby-source-instagram.
@alyssaaaa can i close this? did you manage to find what you were looking for?
from gatsby-source-instagram.
@oorestisime, thank you for your quick response. I performed the filter in js as I wasn't able to figure out how to filter the thumbnail array by the config property. TY!
from gatsby-source-instagram.
Sorry to resurrect an old thread - I've been having the same issue, but I put it down to not knowing the GraphQL syntax.
@oorestisime - If you were to look at this again, would you be able to point me in the right direction, or is this a bug?
Thanks in advance 😄
from gatsby-source-instagram.
Hey,
So it is not clear from your message, to me, what are you trying to do. You are also trying to filter the thumbnail data?
from gatsby-source-instagram.
Yes, I've been struggling with this all morning 😢
I've currently got it being filtered on the "client" - but I'm trying to be a bit better at using GraphQL.
I can't seem to filter on any of the "thumbnail" properties.
Any help would be greatly appreciated.
Thanks
from gatsby-source-instagram.
Yeah i still think it is not possible to do this (although i repeat i am also new to graphql).
I wonder why you don't want to do it in the client side, I am not sure you will gain that much in size to be meaningful (although i haven't tested this), or maybe there is another reason i fail to see.
Are you using the same sized thumbnail everywhere? Maybe the plugin could include an option thumbnail_width
that enables filtering them right when the plugin fetches the data, so that when you query you get the desired ones directly.
from gatsby-source-instagram.
Ok, I appreciate your honesty. The truth is I can survive without needing this, but as I am trying to learn GraphQL I have been trying to progress this.
I only started using this plugin yesterday, and it's been my primary source for learning.
Thanks for taking the time to respond.
from gatsby-source-instagram.
Yeah i see no worries!
The thing is that what you try to accomplish (under this context) is not entirely graphql related. The query mentioned above makes use of sift, which helps project results instead of filtering.
Maybe somebody more experienced on that matter can help out. i suggest you join (if not done already) reactiflux community https://www.reactiflux.com/ and try your luck in gatsby channel
from gatsby-source-instagram.
In any case if there's something to change in the plugin i am more happy to do it or accept a contribution for it :)
from gatsby-source-instagram.
Related Issues (20)
- Cannot read property 'next' of undefined
- sourced image URL expires after a few days HOT 1
- Cannot read property 'edge_owner_to_timeline_media' HOT 2
- I can use version 0.6.1, but not 0.9.0 (Cannot query field "allInstaNode" on type "Query") [Gatsby 2.27.0] HOT 3
- Use maxPosts for scraping method HOT 1
- Hashtag Graph API function doesn't work HOT 5
- Cannnot get last 3 posts HOT 1
- Does using the Graph API remove the 50 posts limit? HOT 1
- New gatsby version issue HOT 7
- Error status Error: Request failed with status code 500 HOT 2
- Could not fetch instagram posts. Error status TypeError: Cannot read property 'user' of undefined HOT 13
- Unable to queryCarousel Images when scraping public posts HOT 1
- Migrating to safer typescript implementation HOT 3
- Dependency Dashboard
- Build works fine locally, but fails on Gatsby Cloud HOT 5
- Extend the Facebook/Instagram access token time HOT 2
- Error while running the sourceNodes lifecycle HOT 2
- Maintenance HOT 3
- NPM peer dependencies update HOT 1
- url signature expired
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-source-instagram.