Comments (11)
@namoscagnm hmmm, I think you are missing the forest for the trees on this one. What you need to do here is sort the objectives so that the objectives are arranged from the latest on to the earliest one. And in order to do this you would likely add a pattern match like this one
backend/lib/bespiral/commune/commune.ex
Line 27 in a6d52d0
and in your pattern match you can run a query that sorts the objectives something like
def query(Objective, _params) do
# do your query and sort here
end
Let us know if we can explain this further
from backend.
Hi @namoscagnm so I realized I might have explained this very curtly and perhaps this was not very helpful to show you what is happening.
So first off you need to understand we are using dataloader, you can read some of the docs here
https://github.com/absinthe-graphql/dataloader/blob/0451ee23d618a8e253262a5d7dd423d2e60e666a/lib/dataloader.ex#L8
and also check out this sample explainer project
absinthe-graphql/absinthe_tutorial#11
On testing
You can write a unit test such as where you do the following checks
- Insert objectives with random dates
- Use your resolver to fetch objectives in the test
- Ensure that the first objective in the list is the objective with the latest date ( this ensures that your sorting is working) like this assertion here
Your code is correct, however I dont see why you need the filters parameter as it is not used, I could be wrong on this though
Let me know if I can explain this further, I could make time for a call to take you through specific tests too
from backend.
from backend.
@GettyOrawo this is a super easy way of getting your hands dirty ...
from backend.
Hi, can you assign this to me?
Thank you!
from backend.
good luck @namoscagnm, this will mainly take you to understand and work with absinthe! be sure to check their documentation!
from backend.
Hi, I am new to graphql, but I managed to find the Objective class by querying:
{
__schema {
types {
name
}
}
}
and I get an "Objective type" inside the response.
I supposed that your problem arises when you query for a list of all responses?
I'm not sure its so, but I tried many commands, including:
After this, I tried to get a list of all objects by typing:
{
objective {
id
}
}
But this didnt work because of a missing input, so I will try out more stuff...
Is it generally possible to list all entries in graphql withtout specyfing any input?
Thanks
from backend.
+1 for @zacck comment
from backend.
Hi, thanks for pointing on the code where the changes will start.
I tried the easiest possible solution given what you proposed, but honestly I would have never been able to navigate to the correct part of the code only from the description.
I have no way of testing if this works or not (it compiles at least), because I do not know how to test it. As I said before i tried it via the API, but it didnt work. Here is my code change:
Even if the code is correct, could any of you (@lucca65, @zacck ) tell me how to test it, so I can be more independent next time?
Thank you!
from backend.
A call would be nice. How can we do it? Via WhatsApp?
Lucca has my Telegram. You can ask him my contact.
from backend.
@lucca65 please share the contact details ...
from backend.
Related Issues (20)
- Criar página HTML de gerenciamento das preferências de email HOT 1
- Utilizar um sistema de workers para despacho de emails
- Prevent a nil bio field to crash rich link rendering
- Detectar strings vazias e transformá-las em `nil` quando apropriado HOT 3
- Corrigir tradução do email de digest em espanhol HOT 1
- Postgrex.Error: ERROR 22001 (string_data_right_truncation) value too long for type character varying(255)
- Backend script
- Product creatorId changes when updating categories as admin
- Add non-null constraint to community logo HOT 1
- Adicionar nome da comunidade no assunto de Digest HOT 4
- Update email info HOT 14
- Resume Oban mail queue
- Fix visual bugs on email unsubscribe screen
- Add info to claim email HOT 1
- Error when accessing rich link route from browser
- Refactor monthly digest email worker HOT 6
- Rodar projeto de bots HOT 9
- Error when getting rich link language
- Fix manifest start url
- [BUG] minor issue with error handling in two Oban jobs
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 backend.